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

Method FirstIDX

ent/share_query.go:146–152  ·  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

144
145// FirstIDX is like FirstID, but panics if an error occurs.
146func (sq *ShareQuery) FirstIDX(ctx context.Context) int {
147 id, err := sq.FirstID(ctx)
148 if err != nil && !IsNotFound(err) {
149 panic(err)
150 }
151 return id
152}
153
154// Only returns a single Share entity found by the query, ensuring it only returns one.
155// Returns a *NotSingularError when more than one Share entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected