]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use Windows %AppData% for build cache if %LocalAppData% is empty
authorBrad Fitzpatrick <bradfitz@golang.org>
Sat, 13 Jan 2018 15:28:42 +0000 (15:28 +0000)
committerIan Lance Taylor <iant@golang.org>
Sun, 14 Jan 2018 04:28:27 +0000 (04:28 +0000)
Fixes #23190

Change-Id: I96805aaab44ddaae6098b4e3af30f9e52585eae0
Reviewed-on: https://go-review.googlesource.com/87675
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/internal/cache/default.go

index 8a5c12c5f59ac06e544ab33b59588be5998a2200..8285f787d4c9cae46b178f6ecee94ae538fdcfbe 100644 (file)
@@ -68,6 +68,11 @@ func DefaultDir() string {
        switch runtime.GOOS {
        case "windows":
                dir = os.Getenv("LocalAppData")
+               if dir == "" {
+                       // Fall back to %AppData%, the old name of
+                       // %LocalAppData% on Windows XP.
+                       dir = os.Getenv("AppData")
+               }
                if dir == "" {
                        return "off"
                }