MCPcopy Index your code
hub / github.com/go-errors/errors / ExampleErrorf

Function ExampleErrorf

error_test.go:213–218  ·  view source on GitHub ↗
(x int)

Source from the content-addressed store, hash-verified

211}
212
213func ExampleErrorf(x int) (int, error) {
214 if x%2 == 1 {
215 return 0, Errorf("can only halve even numbers, got %d", x)
216 }
217 return x / 2, nil
218}
219
220func ExampleWrapError() (error, error) {
221 // Wrap io.EOF with the current stack-trace and return it

Callers

nothing calls this directly

Calls 1

ErrorfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…