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

Method FirstIDX

ent/file_query.go:288–294  ·  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

286
287// FirstIDX is like FirstID, but panics if an error occurs.
288func (fq *FileQuery) FirstIDX(ctx context.Context) int {
289 id, err := fq.FirstID(ctx)
290 if err != nil && !IsNotFound(err) {
291 panic(err)
292 }
293 return id
294}
295
296// Only returns a single File entity found by the query, ensuring it only returns one.
297// Returns a *NotSingularError when more than one File entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected