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

Method FirstX

ent/task_query.go:98–104  ·  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

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

Callers

nothing calls this directly

Calls 2

FirstMethod · 0.95
IsNotFoundFunction · 0.85

Tested by

no test coverage detected