MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / FirstX

Method FirstX

ent/node_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 (nq *NodeQuery) FirstX(ctx context.Context) *Node {
100 node, err := nq.First(ctx)
101 if err != nil && !IsNotFound(err) {
102 panic(err)
103 }
104 return node
105}
106
107// FirstID returns the first Node ID from the query.
108// Returns a *NotFoundError when no Node ID was found.

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected