dashboard/utils/runtime.go

13 lines
170 B
Go

package utils
import (
"reflect"
"runtime"
)
func GetFuncName(fn interface{}) string {
ptr := reflect.ValueOf(fn).Pointer()
return runtime.FuncForPC(ptr).Name()
}