Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
main: only use local cache on install for -nonet (#93)
Browse files Browse the repository at this point in the history
Using the local module cache for installs unconditionally means that
there will be situations where that cache is incomplete and hence the
install (and any subsequent step) will fail.

Rather we only need to enforce the use of the local module cache when we
are in -nonet.

Hence we now allow network access in the case of a module cache miss in
the non-nonet situation, which is exactly the semantics we intend.

Test to follow.

Fixes #86
  • Loading branch information
myitcv authored Apr 7, 2020
1 parent 53acfdc commit aa4157f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,11 @@ func mainerr() error {
}
installCmd.Args = append(installCmd.Args, mp.ImportPath)
installCmd.Dir = pkg.wd
installCmd.Env = append(buildEnv(localCacheProxy), "GOBIN="+gobin)
proxy := ""
if *fNoNet {
proxy = localCacheProxy
}
installCmd.Env = append(buildEnv(proxy), "GOBIN="+gobin)
if err := installCmd.run(); err != nil {
return err
}
Expand Down

0 comments on commit aa4157f

Please sign in to comment.