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

Function FuncNameSkip

coderd/tracing/util.go:26–37  ·  view source on GitHub ↗
(skip int)

Source from the content-addressed store, hash-verified

24}
25
26func FuncNameSkip(skip int) string {
27 fnpc, _, _, ok := runtime.Caller(1 + skip)
28 if !ok {
29 return ""
30 }
31 fn := runtime.FuncForPC(fnpc)
32 name := fn.Name()
33 if i := strings.LastIndex(name, "/"); i > 0 {
34 name = name[i+1:]
35 }
36 return name
37}
38
39// RunWithoutSpan runs the given function with the span stripped from the
40// context and replaced with a no-op span. This is useful for avoiding logs

Callers 3

FuncNameFunction · 0.85
StartSpanFunction · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected