1 //go:build !windows 2 // +build !windows 3 4 package klog 5 6 import ( 7 "os/user" 8 ) 9 10 func getUserName() string { 11 userNameOnce.Do(func() { 12 current, err := user.Current() 13 if err == nil { 14 userName = current.Username 15 } 16 }) 17 18 return userName 19 } 20