gouick/helpers/debug.go

13 lines
260 B
Go
Raw Permalink Normal View History

package helpers
import (
"runtime"
)
// GetCurrentFuncName will return the current function's name.
// It can be used for a better log debug system.
func GetCurrentFuncName() string {
pc, _, _, _ := runtime.Caller(1)
return runtime.FuncForPC(pc).Name()
}