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

Method OnlyX

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

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

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected