MCPcopy
hub / github.com/crowdsecurity/crowdsec / OnlyX

Method OnlyX

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

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected