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.
()
| 143 | // MarshalText formats a stacktrace Frame as a text string. The output is the |
| 144 | // same as that of fmt.Sprintf("%+v", f), but without newlines or tabs. |
| 145 | func (f frame) MarshalText() ([]byte, error) { |
| 146 | name := f.name() |
| 147 | if name == "unknown" { |
| 148 | return []byte(name), nil |
| 149 | } |
| 150 | return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil |
| 151 | } |
| 152 | |
| 153 | // Format formats the stack of Frames according to the fmt.Formatter interface. |
| 154 | // |