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

Method OnlyX

ent/setting_query.go:124–130  ·  view source on GitHub ↗

OnlyX is like Only, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

122
123// OnlyX is like Only, but panics if an error occurs.
124func (sq *SettingQuery) OnlyX(ctx context.Context) *Setting {
125 node, err := sq.Only(ctx)
126 if err != nil {
127 panic(err)
128 }
129 return node
130}
131
132// OnlyID is like Only, but returns the only Setting ID in the query.
133// Returns a *NotSingularError when more than one Setting ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected