MCPcopy Index your code
hub / github.com/go-errors/errors / Stack

Method Stack

error.go:162–170  ·  view source on GitHub ↗

Stack returns the callstack formatted the same way that go does in runtime/debug.Stack()

()

Source from the content-addressed store, hash-verified

160// Stack returns the callstack formatted the same way that go does
161// in runtime/debug.Stack()
162func (err *Error) Stack() []byte {
163 buf := bytes.Buffer{}
164
165 for _, frame := range err.StackFrames() {
166 buf.WriteString(frame.String())
167 }
168
169 return buf.Bytes()
170}
171
172// Callers satisfies the bugsnag ErrorWithCallerS() interface
173// so that the stack can be read out.

Callers 5

ErrorStackMethod · 0.95
BenchmarkStackFormatFunction · 0.80
TestStackFormatFunction · 0.80
TestNewFunction · 0.80
ExampleError_StackFunction · 0.80

Calls 2

StackFramesMethod · 0.95
StringMethod · 0.80

Tested by 4

BenchmarkStackFormatFunction · 0.64
TestStackFormatFunction · 0.64
TestNewFunction · 0.64
ExampleError_StackFunction · 0.64