...

Source file src/k8s.io/klog/v2/klog_file_others.go

Documentation: k8s.io/klog/v2

     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  

View as plain text