MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / FirstIDX

Method FirstIDX

ent/metadata_query.go:121–127  ·  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

119
120// FirstIDX is like FirstID, but panics if an error occurs.
121func (mq *MetadataQuery) FirstIDX(ctx context.Context) int {
122 id, err := mq.FirstID(ctx)
123 if err != nil && !IsNotFound(err) {
124 panic(err)
125 }
126 return id
127}
128
129// Only returns a single Metadata entity found by the query, ensuring it only returns one.
130// Returns a *NotSingularError when more than one Metadata entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected