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

Method OnlyX

ent/storagepolicy_query.go:221–227  ·  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

219
220// OnlyX is like Only, but panics if an error occurs.
221func (spq *StoragePolicyQuery) OnlyX(ctx context.Context) *StoragePolicy {
222 node, err := spq.Only(ctx)
223 if err != nil {
224 panic(err)
225 }
226 return node
227}
228
229// OnlyID is like Only, but returns the only StoragePolicy ID in the query.
230// Returns a *NotSingularError when more than one StoragePolicy ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected