File: klog_file_others.go

package info (click to toggle)
golang-k8s-klog 2.130.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 812 kB
  • sloc: sh: 86; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 241 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//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
}