Skip to content

Commit

Permalink
modules: Set GOCACHE env var
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bep committed Dec 22, 2021
1 parent 728feae commit 0016e21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/client.go
Expand Up @@ -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
Expand Down

0 comments on commit 0016e21

Please sign in to comment.