MCPcopy Create free account
hub / github.com/crowdsecurity/crowdsec / OnlyX

Method OnlyX

pkg/database/ent/machine_query.go:150–156  ·  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

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

Callers

nothing calls this directly

Calls 1

OnlyMethod · 0.95

Tested by

no test coverage detected