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:
parent
9745eed4fd
commit
9f31353a6c
5
src/cmd/go/internal/cache/default.go
vendored
5
src/cmd/go/internal/cache/default.go
vendored
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user