MCPcopy
hub / github.com/duke-git/lancet / Stacks

Method Stacks

xerror/stack.go:23–34  ·  view source on GitHub ↗

Stacks returns stack trace array generated by pkg/errors

()

Source from the content-addressed store, hash-verified

21
22// Stacks returns stack trace array generated by pkg/errors
23func (e *XError) Stacks() []*Stack {
24 resp := make([]*Stack, len(*e.stack))
25 for i, st := range *e.stack {
26 f := frame(st)
27 resp[i] = &Stack{
28 Func: f.name(),
29 File: f.file(),
30 Line: f.line(),
31 }
32 }
33 return resp
34}
35
36// StackTrace returns stack trace which is compatible with pkg/errors
37func (e *XError) StackTrace() StackTrace {

Callers 3

InfoMethod · 0.95
ExampleXError_StackTraceFunction · 0.80
TestXError_StackTraceFunction · 0.80

Calls 4

frameTypeAlias · 0.85
nameMethod · 0.80
fileMethod · 0.80
lineMethod · 0.80

Tested by 2

ExampleXError_StackTraceFunction · 0.64
TestXError_StackTraceFunction · 0.64