You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
241 B
20 lines
241 B
2 years ago
|
//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
|
||
|
}
|