gouick/helpers/debug.go
2022-08-09 21:37:39 +00:00

13 lines
260 B
Go

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()
}