]> Cypherpunks repositories - gostls13.git/commit
cmd/go: preserve sums for indirect deps fetched by 'go mod download'
authorJay Conrod <jayconrod@google.com>
Fri, 8 Jan 2021 18:24:23 +0000 (13:24 -0500)
committerJay Conrod <jayconrod@google.com>
Fri, 8 Jan 2021 19:48:42 +0000 (19:48 +0000)
commit25886cf4bd28be373afb80a4c068a785b43bdddf
treec00ece305d257df798ef8f278684e3363548f755
parent6250833911fc979a4ca5ba8b7f0612d054a3aeec
cmd/go: preserve sums for indirect deps fetched by 'go mod download'

Previously, commands that wrote go.sum (except 'go mod tidy') would
retain sums for zip files of directly required modules. Sums of
indirect dependencies wouldn't be retained unless they were used to
load packages.

With this change, sums for indirect dependencies will be retained if
they're available. This allows users to add missing sums with
'go mod download example.com/mod', which previously only worked for
directly required modules.

Note that 'go mod download' without arguments now adds sums for every
module in the build list. That matches 1.15 behavior.

For #41103

Change-Id: I4cce2bf1c73578dae836bdb5adb32da071554f1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/282692
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modload/init.go
src/cmd/go/testdata/script/mod_sum_ambiguous.txt