Files
public/tools/reflect.go
2020-03-29 21:06:06 +08:00

12 lines
173 B
Go

package tools
import (
"reflect"
"runtime"
)
//获取函数名
func GetFuncName(f interface{}) string {
return runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
}