github.com/aliyun/credentials-go@v1.4.7/credentials/internal/utils/path.go (about) 1 package utils 2 3 import ( 4 "os" 5 "runtime" 6 ) 7 8 var getOS = func() string { 9 return runtime.GOOS 10 } 11 12 func GetHomePath() string { 13 if getOS() == "windows" { 14 return os.Getenv("USERPROFILE") 15 } 16 17 return os.Getenv("HOME") 18 }