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

Method FirstIDX

ent/node_query.go:122–128  ·  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

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

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected