1
0
mirror of https://github.com/golang/go synced 2024-09-30 06:14:31 -06:00

cmd/go: use Windows %AppData% for build cache if %LocalAppData% is empty

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>
This commit is contained in:
Brad Fitzpatrick 2018-01-13 15:28:42 +00:00 committed by Ian Lance Taylor
parent 9745eed4fd
commit 9f31353a6c

View 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"
}