Package runtime

https://golang.org/pkg/runtime/

Table of Contents

Get the name of a function as a string howto

func GetFunctionName(i interface{}) string {
    fp := reflect.ValueOf(i).Pointer()
    return runtime.FuncForPC(fp).Name()
}