1
0
mirror of https://github.com/golang/go synced 2024-11-23 17:50:06 -07:00

cmd/go: disable implicit $GOCACHE when clearing $HOME in test

Change-Id: Ie9967c8aaf7cf2e90a442937df21b1218f7ae26f
Reviewed-on: https://go-review.googlesource.com/75472
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Russ Cox 2017-11-02 09:19:10 -04:00
parent 3392c0711d
commit 5e35954a8c

View File

@ -155,6 +155,9 @@ func TestMain(m *testing.M) {
os.Setenv("CCACHE_DIR", filepath.Join(home, ".ccache"))
}
os.Setenv("HOME", "/test-go-home-does-not-exist")
if os.Getenv("GOCACHE") == "" {
os.Setenv("GOCACHE", "off") // because $HOME is gone
}
r := m.Run()