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
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 committed Apr 7, 2020
1 parent 1731fcc commit ff58ee9
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 ff58ee9

Please sign in to comment.