MCPcopy Create free account
hub / github.com/DNAProject/DNA / CallStacksString

Function CallStacksString

errors/callstack.go:45–58  ·  view source on GitHub ↗
(call *CallStack)

Source from the content-addressed store, hash-verified

43}
44
45func CallStacksString(call *CallStack) string {
46 buf := bytes.Buffer{}
47 if call == nil {
48 return fmt.Sprintf("No call stack available")
49 }
50
51 for _, stack := range call.Stacks {
52 f := runtime.FuncForPC(stack)
53 file, line := f.FileLine(stack)
54 buf.WriteString(fmt.Sprintf("%s:%d - %s\n", file, line, f.Name()))
55 }
56
57 return fmt.Sprintf("%s", buf.Bytes())
58}
59
60func getCallStack(skip int, depth int) *CallStack {
61 stacks := make([]uintptr, depth)

Callers 1

TestNewDetailErrFunction · 0.85

Calls 2

WriteStringMethod · 0.80
BytesMethod · 0.45

Tested by 1

TestNewDetailErrFunction · 0.68