Skip to content

Commit 8a6eab4

Browse files
committed
Use "user" environment variable instead of "USER" on Plan 9
Ref: #744
1 parent 99baf2f commit 8a6eab4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

internal/pqutil/user_posix.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ package pqutil
55
import (
66
"os"
77
"os/user"
8+
"runtime"
89
)
910

1011
func User() (string, error) {
11-
if n := os.Getenv("USER"); n != "" {
12+
env := "USER"
13+
if runtime.GOOS == "plan9" {
14+
env = "user"
15+
}
16+
if n := os.Getenv(env); n != "" {
1217
return n, nil
1318
}
1419

0 commit comments

Comments
 (0)