MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / Bool

Method Bool

app/controlplane/pkg/data/ent/ent.go:504–518  ·  view source on GitHub ↗

Bool returns a single bool from a selector. It is only allowed when selecting one field.

(ctx context.Context)

Source from the content-addressed store, hash-verified

502
503// Bool returns a single bool from a selector. It is only allowed when selecting one field.
504func (s *selector) Bool(ctx context.Context) (_ bool, err error) {
505 var v []bool
506 if v, err = s.Bools(ctx); err != nil {
507 return
508 }
509 switch len(v) {
510 case 1:
511 return v[0], nil
512 case 0:
513 err = &NotFoundError{s.label}
514 default:
515 err = fmt.Errorf("ent: Bools returned %d results when one was expected", len(v))
516 }
517 return
518}
519
520// BoolX is like Bool, but panics if an error occurs.
521func (s *selector) BoolX(ctx context.Context) bool {

Callers 15

BoolXMethod · 0.95
VerifyMethod · 0.80
VerifyGitHubCommitFunction · 0.80
uploadAndCraftFunction · 0.80
CraftMethod · 0.80
FieldsMethod · 0.80
FieldsMethod · 0.80
FieldsMethod · 0.80
FieldsMethod · 0.80
FieldsMethod · 0.80
FieldsMethod · 0.80
FieldsMethod · 0.80

Calls 1

BoolsMethod · 0.95

Tested by

no test coverage detected