Bools returns list of bools from a selector. It is only allowed when selecting one field.
(ctx context.Context)
| 481 | |
| 482 | // Bools returns list of bools from a selector. It is only allowed when selecting one field. |
| 483 | func (s *selector) Bools(ctx context.Context) ([]bool, error) { |
| 484 | if len(*s.flds) > 1 { |
| 485 | return nil, errors.New("ent: Bools is not achievable when selecting more than 1 field") |
| 486 | } |
| 487 | var v []bool |
| 488 | if err := s.scan(ctx, &v); err != nil { |
| 489 | return nil, err |
| 490 | } |
| 491 | return v, nil |
| 492 | } |
| 493 | |
| 494 | // BoolsX is like Bools, but panics if an error occurs. |
| 495 | func (s *selector) BoolsX(ctx context.Context) []bool { |