k3s/pkg/util/reflect.go

11 lines
158 B
Go
Raw Normal View History

package util
import (
"reflect"
"runtime"
)
func GetFunctionName(i interface{}) string {
return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
}