Skip to content

Commit

Permalink
cmd/go: use Windows %AppData% for build cache if %LocalAppData% is empty
Browse files Browse the repository at this point in the history
Fixes golang#23190

Change-Id: I96805aaab44ddaae6098b4e3af30f9e52585eae0
Reviewed-on: https://go-review.googlesource.com/87675
Run-TryBot: Brad Fitzpatrick <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
bradfitz authored and ianlancetaylor committed Jan 14, 2018
1 parent 9745eed commit 9f31353
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/go/internal/cache/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 9f31353

Please sign in to comment.