1
0
mirror of https://github.com/golang/go synced 2024-11-19 17:54:48 -07:00

cmd/go: on Windows, disable cache if LocalAppData is not set

Fixes #23146

Change-Id: I06e3328ecca5e27f8e1ada05c2d7cd9bdda714e6
Reviewed-on: https://go-review.googlesource.com/85996
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2018-01-03 09:55:02 -08:00
parent 77ea9f9f31
commit ce94c0a791

View File

@ -68,6 +68,9 @@ func DefaultDir() string {
switch runtime.GOOS {
case "windows":
dir = os.Getenv("LocalAppData")
if dir == "" {
return "off"
}
case "darwin":
dir = os.Getenv("HOME")