1
0
mirror of https://github.com/golang/go synced 2024-11-17 02:04:48 -07:00

os: make UserHomeDir return "/" on iOS

The UserHomeDir test succeeds on the builder, but not when run
manually where HOME is set to the host $HOME.

Change-Id: I1db0f608b04b311b53cc0c8160a3778caaf542f6
Reviewed-on: https://go-review.googlesource.com/c/141798
Run-TryBot: Elias Naur <elias.naur@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Elias Naur 2018-10-12 11:36:54 +02:00
parent a0d6420d8b
commit 93cf82f08a

View File

@ -394,6 +394,11 @@ func UserHomeDir() string {
return Getenv("home")
case "nacl", "android":
return "/"
case "darwin":
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
return "/"
}
fallthrough
default:
return Getenv("HOME")
}