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

Method FirstX

ent/setting_query.go:74–80  ·  view source on GitHub ↗

FirstX is like First, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

72
73// FirstX is like First, but panics if an error occurs.
74func (sq *SettingQuery) FirstX(ctx context.Context) *Setting {
75 node, err := sq.First(ctx)
76 if err != nil && !IsNotFound(err) {
77 panic(err)
78 }
79 return node
80}
81
82// FirstID returns the first Setting ID from the query.
83// Returns a *NotFoundError when no Setting ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected