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

Function GetCaller

wrap_caller.go:25–27  ·  view source on GitHub ↗

GetCaller captures the program counter of a caller, primarily intended for error helpers so caller information captures the helper's caller. Callers of this function should be marked '//go:noinline' to avoid inlining, as GetCaller expects to skip the caller's stack frame. //go:noinline func Wrap

()

Source from the content-addressed store, hash-verified

23//
24//go:noinline
25func GetCaller() Caller {
26 return Caller{pc.GetCallerSkip1()}
27}
28
29// Wrap adds the program counter captured in Caller to the error,
30// similar to [Wrap], but relying on previously captured caller inforamtion.

Callers 6

wrapFunction · 0.92
errorsNewFunction · 0.92
wrapExistingFunction · 0.92
passCallerFunction · 0.92
retCallerFunction · 0.92
retCallerNoInlineFunction · 0.92

Calls 1

GetCallerSkip1Function · 0.92

Tested by 6

wrapFunction · 0.74
errorsNewFunction · 0.74
wrapExistingFunction · 0.74
passCallerFunction · 0.74
retCallerFunction · 0.74
retCallerNoInlineFunction · 0.74