]> Cypherpunks repositories - gostls13.git/commitdiff
os: make UserHomeDir return "/" on iOS
authorElias Naur <elias.naur@gmail.com>
Fri, 12 Oct 2018 09:36:54 +0000 (11:36 +0200)
committerElias Naur <elias.naur@gmail.com>
Fri, 12 Oct 2018 14:25:13 +0000 (14:25 +0000)
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>
src/os/file.go

index 61f37f248925bbd7648ee5ae751349ef7869157a..3e626a023aa48d17a45f629ee9359a50dee6bad6 100644 (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")
        }