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

Method FirstIDX

ent/setting_query.go:97–103  ·  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

95
96// FirstIDX is like FirstID, but panics if an error occurs.
97func (sq *SettingQuery) FirstIDX(ctx context.Context) int {
98 id, err := sq.FirstID(ctx)
99 if err != nil && !IsNotFound(err) {
100 panic(err)
101 }
102 return id
103}
104
105// Only returns a single Setting entity found by the query, ensuring it only returns one.
106// Returns a *NotSingularError when more than one Setting entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected