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

Method FirstX

ent/group_query.go:123–129  ·  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

121
122// FirstX is like First, but panics if an error occurs.
123func (gq *GroupQuery) FirstX(ctx context.Context) *Group {
124 node, err := gq.First(ctx)
125 if err != nil && !IsNotFound(err) {
126 panic(err)
127 }
128 return node
129}
130
131// FirstID returns the first Group ID from the query.
132// Returns a *NotFoundError when no Group ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected