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

Method FirstIDX

pkg/database/ent/alert_query.go:196–202  ·  view source on GitHub ↗

FirstIDX is like FirstID, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

194
195// FirstIDX is like FirstID, but panics if an error occurs.
196func (_q *AlertQuery) FirstIDX(ctx context.Context) int {
197 id, err := _q.FirstID(ctx)
198 if err != nil && !IsNotFound(err) {
199 panic(err)
200 }
201 return id
202}
203
204// Only returns a single Alert entity found by the query, ensuring it only returns one.
205// Returns a *NotSingularError when more than one Alert entity is found.

Callers

nothing calls this directly

Calls 2

FirstIDMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected