// Bool returns a single bool from a selector. It is only allowed when selecting one field.
Bool returns a single bool from a selector. It is only allowed when selecting one field.
// Bool returns a single bool from a selector . It is only allowed when selecting one field .
func (fts *FactTypeSelect) Bool(ctx context.Context) (_ bool, err error) {
	var v []bool
	if v, err = fts.Bools(ctx); err != nil {
		return
	}
	switch len(v) {
	case 1:
		return v[0], nil
	case 0:
		err = &NotFoundError{facttype.Label}
	default:
		err = fmt.Errorf("ent: FactTypeSelect.Bools returned %d results when one was expected", len(v))
	}
	return
}
func ( fts * FactTypeSelect ) Bool ( ctx context . Context ) ( _ bool , err error ) { var v [ ] bool if v , err = fts . Bools ( ctx ) ; err != nil { return } switch len ( v ) { case 1 : return v [ 0 ] , nil case 0 : err = & NotFoundError { facttype . Label } default : err = fmt . Errorf ( " " , len ( v ) ) } return }
Bool returns a single bool from a selector.
Bool returns a single bool from a selector .