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

Method OnlyX

ent/task_query.go:148–154  ·  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

146
147// OnlyX is like Only, but panics if an error occurs.
148func (tq *TaskQuery) OnlyX(ctx context.Context) *Task {
149 node, err := tq.Only(ctx)
150 if err != nil {
151 panic(err)
152 }
153 return node
154}
155
156// OnlyID is like Only, but returns the only Task ID in the query.
157// Returns a *NotSingularError when more than one Task ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected