Stack returns the stack trace of an error. If the error has no stack information, it returns an empty stack trace.
(err error)
| 8 | // If the error has no stack information, it |
| 9 | // returns an empty stack trace. |
| 10 | func Stack(err error) *runtime.Frames { |
| 11 | wErr, _ := err.(wrapperError) |
| 12 | return runtime.CallersFrames(wErr.stack) |
| 13 | } |
| 14 | |
| 15 | // getStack is an allocating wrapper around runtime.Callers. |
| 16 | func getStack(skip int, max int) []uintptr { |