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

Method FirstX

pkg/database/ent/meta_query.go:99–105  ·  view source on GitHub ↗

FirstX is like First, but panics if an error occurs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

97
98// FirstX is like First, but panics if an error occurs.
99func (_q *MetaQuery) FirstX(ctx context.Context) *Meta {
100 node, err := _q.First(ctx)
101 if err != nil && !IsNotFound(err) {
102 panic(err)
103 }
104 return node
105}
106
107// FirstID returns the first Meta ID from the query.
108// Returns a *NotFoundError when no Meta ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected