MCPcopy Index your code
hub / github.com/coder/coder / getStackString

Function getStackString

coderd/tracing/status_writer.go:121–136  ·  view source on GitHub ↗
(skip int)

Source from the content-addressed store, hash-verified

119}
120
121func getStackString(skip int) string {
122 // Get up to 5 callers, skipping this one and the skip count.
123 pcs := make([]uintptr, 5)
124 got := runtime.Callers(skip+1, pcs)
125 frames := runtime.CallersFrames(pcs[:got])
126
127 callers := []string{}
128 for {
129 frame, more := frames.Next()
130 callers = append(callers, fmt.Sprintf("%s:%v", frame.File, frame.Line))
131 if !more {
132 break
133 }
134 }
135 return strings.Join(callers, " -> ")
136}

Callers 1

WriteHeaderMethod · 0.85

Calls 1

NextMethod · 0.65

Tested by

no test coverage detected