diff --git a/modules/client.go b/modules/client.go index 1924cd5b4c6..5b61e564432 100644 --- a/modules/client.go +++ b/modules/client.go @@ -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