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

Method OnlyX

ent/user_query.go:341–347  ·  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

339
340// OnlyX is like Only, but panics if an error occurs.
341func (uq *UserQuery) OnlyX(ctx context.Context) *User {
342 node, err := uq.Only(ctx)
343 if err != nil {
344 panic(err)
345 }
346 return node
347}
348
349// OnlyID is like Only, but returns the only User ID in the query.
350// 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