13 lines
260 B
Go
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()
|
||
|
}
|