MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / OnlyX

Method OnlyX

ent/entity_query.go:197–203  ·  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

195
196// OnlyX is like Only, but panics if an error occurs.
197func (eq *EntityQuery) OnlyX(ctx context.Context) *Entity {
198 node, err := eq.Only(ctx)
199 if err != nil {
200 panic(err)
201 }
202 return node
203}
204
205// OnlyID is like Only, but returns the only Entity ID in the query.
206// Returns a *NotSingularError when more than one Entity ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected