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

Method FirstX

ent/user_query.go:291–297  ·  view source on GitHub ↗

FirstX is like First, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

289
290// FirstX is like First, but panics if an error occurs.
291func (uq *UserQuery) FirstX(ctx context.Context) *User {
292 node, err := uq.First(ctx)
293 if err != nil && !IsNotFound(err) {
294 panic(err)
295 }
296 return node
297}
298
299// FirstID returns the first User ID from the query.
300// Returns a *NotFoundError when no User ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected