Skip to content

Commit

Permalink
adding cache dir (gomods#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalpristas authored Jul 12, 2018
1 parent d49e896 commit 119e975
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/repo/goget.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ func getSources(fs afero.Fs, gopath, repoRoot, repoURI, version string) (string,
fullURI := fmt.Sprintf("%s@%s", uri, version)

gopathEnv := fmt.Sprintf("GOPATH=%s", gopath)
cacheEnv := fmt.Sprintf("GOCACHE=%s", filepath.Join(gopath, "cache"))
disableCgo := "CGO_ENABLED=0"

cmd := exec.Command("vgo", "get", fullURI)
// PATH is needed for vgo to recognize vcs binaries
// this breaks windows.
cmd.Env = []string{"PATH=" + os.Getenv("PATH"), gopathEnv, disableCgo}
cmd.Env = []string{"PATH=" + os.Getenv("PATH"), gopathEnv, cacheEnv, disableCgo}
cmd.Dir = repoRoot

packagePath := filepath.Join(gopath, "src", "mod", "cache", "download", repoURI, "@v")
Expand Down

0 comments on commit 119e975

Please sign in to comment.