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

Method FirstIDX

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

192
193// FirstIDX is like FirstID, but panics if an error occurs.
194func (spq *StoragePolicyQuery) FirstIDX(ctx context.Context) int {
195 id, err := spq.FirstID(ctx)
196 if err != nil && !IsNotFound(err) {
197 panic(err)
198 }
199 return id
200}
201
202// Only returns a single StoragePolicy entity found by the query, ensuring it only returns one.
203// Returns a *NotSingularError when more than one StoragePolicy entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected