Skip to content

Commit 0016e21

Browse files
committed
modules: Set GOCACHE env var
This was introduced in Go 1.15. We do set the GOPATH, which should be enough, but gohugoio#9309 indicate that's not the case on every platform (GitHub Actions). Closes gohugoio#9309
1 parent 728feae commit 0016e21

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎modules/client.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func NewClient(cfg ClientConfig) *Client {
9090
"GOPRIVATE", mcfg.Private,
9191
"GONOPROXY", mcfg.NoProxy,
9292
"GOPATH", cfg.CacheDir,
93+
// GOCACHE was introduced in Go 1.15. This matches the location derived from GOPATH above.
94+
"GOCACHE", filepath.Join(cfg.CacheDir, "pkg", "mod"),
9395
)
9496

9597
logger := cfg.Logger

0 commit comments

Comments
 (0)