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

Function wrap

errtrace.go:65–70  ·  view source on GitHub ↗
(err error, callerPC uintptr)

Source from the content-addressed store, hash-verified

63var _arena = newArena[errTrace](1024)
64
65func wrap(err error, callerPC uintptr) error {
66 et := _arena.Take()
67 et.err = err
68 et.pc = callerPC
69 return et
70}
71
72// Format writes the return trace for given error to the writer.
73// The output takes a format similar to the following:

Callers 10

WrapMethod · 0.70
TestUnwrapFrame_badPCFunction · 0.70
WrapFunction · 0.70
Wrap2Function · 0.70
Wrap3Function · 0.70
Wrap4Function · 0.70
Wrap5Function · 0.70
Wrap6Function · 0.70
NewFunction · 0.70
ErrorfFunction · 0.70

Calls 1

TakeMethod · 0.80

Tested by 1

TestUnwrapFrame_badPCFunction · 0.56