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

Method FirstX

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

263
264// FirstX is like First, but panics if an error occurs.
265func (fq *FileQuery) FirstX(ctx context.Context) *File {
266 node, err := fq.First(ctx)
267 if err != nil && !IsNotFound(err) {
268 panic(err)
269 }
270 return node
271}
272
273// FirstID returns the first File ID from the query.
274// Returns a *NotFoundError when no File ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected