MCPcopy
hub / github.com/expr-lang/expr / callerName

Function callerName

internal/testify/assert/assertion_compare_test.go:117–127  ·  view source on GitHub ↗

callerName gives the function name (qualified with a package path) for the caller after skip frames (where 0 means the current function).

(skip int)

Source from the content-addressed store, hash-verified

115// callerName gives the function name (qualified with a package path)
116// for the caller after skip frames (where 0 means the current function).
117func callerName(skip int) string {
118 // Make room for the skip PC.
119 var pc [1]uintptr
120 n := runtime.Callers(skip+2, pc[:]) // skip + runtime.Callers + callerName
121 if n == 0 {
122 panic("testing: zero callers found")
123 }
124 frames := runtime.CallersFrames(pc[:n])
125 frame, _ := frames.Next()
126 return frame.Function
127}
128
129func TestGreater(t *testing.T) {
130 mockT := new(testing.T)

Callers 1

HelperMethod · 0.85

Calls 1

NextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…