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

Method FirstIDX

ent/user_query.go:314–320  ·  view source on GitHub ↗

FirstIDX is like FirstID, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

312
313// FirstIDX is like FirstID, but panics if an error occurs.
314func (uq *UserQuery) FirstIDX(ctx context.Context) int {
315 id, err := uq.FirstID(ctx)
316 if err != nil && !IsNotFound(err) {
317 panic(err)
318 }
319 return id
320}
321
322// Only returns a single User entity found by the query, ensuring it only returns one.
323// Returns a *NotSingularError when more than one User entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected