64f9ea1cf5
full diff: 6341884e5f...b17f02f0a0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
19 lines
241 B
Go
19 lines
241 B
Go
//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
|
|
}
|