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

Method FirstX

ent/share_query.go:123–129  ·  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

121
122// FirstX is like First, but panics if an error occurs.
123func (sq *ShareQuery) FirstX(ctx context.Context) *Share {
124 node, err := sq.First(ctx)
125 if err != nil && !IsNotFound(err) {
126 panic(err)
127 }
128 return node
129}
130
131// FirstID returns the first Share ID from the query.
132// Returns a *NotFoundError when no Share ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected