modules: Set GOCACHE env var

This was introduced in Go 1.15. We do set the GOPATH, which should be enough, but #9309 indicate that's not the case on every platform (GitHub Actions).

Closes #9309
This commit is contained in:
Bjørn Erik Pedersen 2021-12-22 10:53:03 +01:00
parent 728feaecf0
commit 0016e21cd6

View file

@ -90,6 +90,8 @@ func NewClient(cfg ClientConfig) *Client {
"GOPRIVATE", mcfg.Private,
"GONOPROXY", mcfg.NoProxy,
"GOPATH", cfg.CacheDir,
// GOCACHE was introduced in Go 1.15. This matches the location derived from GOPATH above.
"GOCACHE", filepath.Join(cfg.CacheDir, "pkg", "mod"),
)
logger := cfg.Logger