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

Method OnlyX

ent/metadata_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 (mq *MetadataQuery) OnlyX(ctx context.Context) *Metadata {
149 node, err := mq.Only(ctx)
150 if err != nil {
151 panic(err)
152 }
153 return node
154}
155
156// OnlyID is like Only, but returns the only Metadata ID in the query.
157// Returns a *NotSingularError when more than one Metadata ID is found.

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected