Files
public/tools/reflect.go
2020-12-29 11:59:27 +08:00

12 lines
186 B
Go

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