github.com/bingoohuang/gg@v0.0.0-20240325092523-45da7dee9335/pkg/fn/reflect.go (about) 1 package fn 2 3 import ( 4 "reflect" 5 "runtime" 6 ) 7 8 // GetFuncName returns the func name of a func. 9 func GetFuncName(i interface{}) string { 10 // github.com/bingoohuang/gg/pkg/fn.GetFuncName 11 return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() 12 }