VictoriaMetrics/vendor/k8s.io/klog/v2/klog_file_others.go

20 lines
241 B
Go
Raw Normal View History

2024-02-24 02:22:39 +01:00
//go:build !windows
// +build !windows
package klog
import (
"os/user"
)
func getUserName() string {
userNameOnce.Do(func() {
current, err := user.Current()
if err == nil {
userName = current.Username
}
})
return userName
}