]> Cypherpunks repositories - gostls13.git/commit
cmd/go: download fewer dependencies in 'go mod download'
authorBryan C. Mills <bcmills@google.com>
Wed, 20 Oct 2021 18:02:24 +0000 (14:02 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 4 Nov 2021 20:42:35 +0000 (20:42 +0000)
commit1f9dce749db804a8cce767adde3701378db1461c
tree6df5f97dedb8045d394b4a0a6a8dd309286ff0ca
parent978e39e9e647d7359a41ac32992ef6ff5380be08
cmd/go: download fewer dependencies in 'go mod download'

In modules that specify 'go 1.17' or higher, the go.mod file
explicitly requires modules for all packages transitively imported by
the main module. Users tend to use 'go mod download' to prepare for
testing the main module itself, so we should only download those
relevant modules.

In 'go 1.16' and earlier modules, we continue to download all modules
in the module graph (because we cannot in general tell which ones are
relevant without loading the full package import graph).

'go mod download all' continues to download every module in
'go list all', as it did before.

Fixes #44435

Change-Id: I3f286c0e2549d6688b3832ff116e6cd77a19401c
Reviewed-on: https://go-review.googlesource.com/c/go/+/357310
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
doc/go1.18.html
src/cmd/go/alldocs.go
src/cmd/go/internal/modcmd/download.go
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/modfile.go
src/cmd/go/testdata/script/mod_download.txt