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

Method OnlyX

ent/share_query.go:173–179  ·  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

171
172// OnlyX is like Only, but panics if an error occurs.
173func (sq *ShareQuery) OnlyX(ctx context.Context) *Share {
174 node, err := sq.Only(ctx)
175 if err != nil {
176 panic(err)
177 }
178 return node
179}
180
181// OnlyID is like Only, but returns the only Share ID in the query.
182// Returns a *NotSingularError when more than one Share ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected