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

Method FirstX

ent/storagepolicy_query.go:171–177  ·  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

169
170// FirstX is like First, but panics if an error occurs.
171func (spq *StoragePolicyQuery) FirstX(ctx context.Context) *StoragePolicy {
172 node, err := spq.First(ctx)
173 if err != nil && !IsNotFound(err) {
174 panic(err)
175 }
176 return node
177}
178
179// FirstID returns the first StoragePolicy ID from the query.
180// Returns a *NotFoundError when no StoragePolicy ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected