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

Method MarshalText

xerror/stack.go:145–151  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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.
145func (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//

Callers

nothing calls this directly

Calls 3

nameMethod · 0.95
fileMethod · 0.95
lineMethod · 0.95

Tested by

no test coverage detected