MCPcopy Index your code
hub / github.com/go-errors/errors / String

Method String

stackframe.go:53–62  ·  view source on GitHub ↗

String returns the stackframe formatted in the same way as go does in runtime/debug.Stack()

()

Source from the content-addressed store, hash-verified

51// String returns the stackframe formatted in the same way as go does
52// in runtime/debug.Stack()
53func (frame *StackFrame) String() string {
54 str := fmt.Sprintf("%s:%d (0x%x)\n", frame.File, frame.LineNumber, frame.ProgramCounter)
55
56 source, err := frame.sourceLine()
57 if err != nil {
58 return str
59 }
60
61 return str + fmt.Sprintf("\t%s: %s\n", frame.Name, source)
62}
63
64// SourceLine gets the line of code (from File and Line) of the original source if possible.
65func (frame *StackFrame) SourceLine() (string, error) {

Callers 3

StackMethod · 0.80
TypeNameMethod · 0.80
readableStackTraceFunction · 0.80

Calls 1

sourceLineMethod · 0.95

Tested by 1

readableStackTraceFunction · 0.64