From: Elias Naur Date: Fri, 12 Oct 2018 09:36:54 +0000 (+0200) Subject: os: make UserHomeDir return "/" on iOS X-Git-Tag: go1.12beta1~804 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=93cf82f08af78869a721d4e48fc4fd1ce08cd259;p=gostls13.git 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 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/os/file.go b/src/os/file.go index 61f37f2489..3e626a023a 100644 --- a/src/os/file.go +++ b/src/os/file.go @@ -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") }