mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-01 04:10:51 +02:00
16 lines
216 B
Go
16 lines
216 B
Go
package util
|
|
|
|
import "runtime"
|
|
|
|
func GetCallerName() string {
|
|
pc, _, _, ok := runtime.Caller(2)
|
|
if !ok {
|
|
return "unknown"
|
|
}
|
|
fn := runtime.FuncForPC(pc)
|
|
if fn == nil {
|
|
return "unknown"
|
|
}
|
|
return fn.Name()
|
|
}
|