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

Function wrap

example_errhelper_test.go:23–26  ·  view source on GitHub ↗
(err error, fields ...string)

Source from the content-addressed store, hash-verified

21}
22
23func wrap(err error, fields ...string) error {
24 return errtrace.GetCaller().
25 Wrap(fmt.Errorf("%w %v", err, fields))
26}
27
28func Example_getCaller() {
29 got := errtrace.FormatString(f1Wrap())

Callers 3

f1WrapFunction · 0.70
f2WrapFunction · 0.70
f3WrapFunction · 0.70

Calls 2

GetCallerFunction · 0.92
WrapMethod · 0.80

Tested by

no test coverage detected