MarshalText formats a stacktrace Frame as a text string. The output is the same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
()
| 86 | // MarshalText formats a stacktrace Frame as a text string. The output is the |
| 87 | // same as that of fmt.Sprintf("%+v", f), but without newlines or tabs. |
| 88 | func (f Frame) MarshalText() ([]byte, error) { |
| 89 | name := f.name() |
| 90 | if name == "unknown" { |
| 91 | return []byte(name), nil |
| 92 | } |
| 93 | return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil |
| 94 | } |
| 95 | |
| 96 | // StackTrace is stack of Frames from innermost (newest) to outermost (oldest). |
| 97 | type StackTrace []Frame |