(skip int)
| 24 | } |
| 25 | |
| 26 | func 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 |
no test coverage detected