Skip to content

Commit ac3abdc

Browse files
Wilken Riveranywilken
authored andcommitted
Use login user name when available
1 parent 62bcc50 commit ac3abdc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pathing/config_file_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package pathing
55

66
import (
77
"fmt"
8+
"os"
89
"os/user"
910
"path/filepath"
1011
"runtime"
@@ -17,6 +18,9 @@ func platform_user() string {
1718
// on the windows platform, whereas the correct way is to use
1819
// the api or to scrape `net user`.
1920
if runtime.GOOS == "windows" {
21+
if loginUser := os.Getenv("USERNAME"); loginUser != "" {
22+
return loginUser
23+
}
2024
return "Administrator"
2125
}
2226
return "root"

0 commit comments

Comments
 (0)