MCPcopy Index your code
hub / github.com/pkg/errors / MarshalText

Method MarshalText

stack.go:88–94  ·  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

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.
88func (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).
97type StackTrace []Frame

Callers 1

TestFrameMarshalTextFunction · 0.80

Calls 3

nameMethod · 0.95
fileMethod · 0.95
lineMethod · 0.95

Tested by 1

TestFrameMarshalTextFunction · 0.64