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

Method FirstIDX

ent/task_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 (tq *TaskQuery) FirstIDX(ctx context.Context) int {
122 id, err := tq.FirstID(ctx)
123 if err != nil && !IsNotFound(err) {
124 panic(err)
125 }
126 return id
127}
128
129// Only returns a single Task entity found by the query, ensuring it only returns one.
130// Returns a *NotSingularError when more than one Task entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected