From 93cf82f08af78869a721d4e48fc4fd1ce08cd259 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 12 Oct 2018 11:36:54 +0200 Subject: [PATCH] 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 --- src/os/file.go | 5 +++++ 1 file changed, 5 insertions(+) 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") } -- 2.50.0