MCPcopy Create free account
hub / github.com/temporalio/temporal / functionName

Function functionName

common/testing/runtime/goroutine.go:120–130  ·  view source on GitHub ↗
(fn any)

Source from the content-addressed store, hash-verified

118}
119
120func functionName(fn any) (string, error) {
121 if fnName, isString := fn.(string); isString {
122 return fnName, nil
123 }
124
125 if fnName, isFunc := functionNameForPC(reflect.ValueOf(fn).Pointer()); isFunc {
126 return fnName, nil
127 }
128
129 return "", errors.New(fmt.Sprintf("Invalid function %#v", fn))
130}
131
132func functionNameForPC(pc uintptr) (string, bool) {
133 fn := runtime.FuncForPC(pc)

Callers 2

WaitGoRoutineWithFnFunction · 0.85
AssertNoGoRoutineWithFnFunction · 0.85

Calls 2

functionNameForPCFunction · 0.85
NewMethod · 0.65

Tested by

no test coverage detected