MCPcopy Index your code
hub / github.com/bracesdev/errtrace / Example_trace

Function Example_trace

example_trace_test.go:26–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func Example_trace() {
27 got := errtrace.FormatString(f1())
28
29 // make trace agnostic to environment-specific location
30 // and less sensitive to line number changes.
31 fmt.Println(tracetest.MustClean(got))
32
33 // Output:
34 //failed
35 //
36 //braces.dev/errtrace_test.f3
37 // /path/to/errtrace/example_trace_test.go:3
38 //braces.dev/errtrace_test.f2
39 // /path/to/errtrace/example_trace_test.go:2
40 //braces.dev/errtrace_test.f1
41 // /path/to/errtrace/example_trace_test.go:1
42}
43
44func f4() error {
45 return errtrace.Wrap(fmt.Errorf("wrapped: %w", f1()))

Callers

nothing calls this directly

Calls 3

FormatStringFunction · 0.92
MustCleanFunction · 0.92
f1Function · 0.70

Tested by

no test coverage detected