MCPcopy Index your code
hub / github.com/chainloop-dev/chainloop / OnlyX

Method OnlyX

app/controlplane/pkg/data/ent/user_query.go:177–183  ·  view source on GitHub ↗

OnlyX is like Only, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

175
176// OnlyX is like Only, but panics if an error occurs.
177func (_q *UserQuery) OnlyX(ctx context.Context) *User {
178 node, err := _q.Only(ctx)
179 if err != nil {
180 panic(err)
181 }
182 return node
183}
184
185// OnlyID is like Only, but returns the only User ID in the query.
186// Returns a *NotSingularError when more than one User ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected