]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: use updateRequirements instead of editRequirements to add...
authorBryan C. Mills <bcmills@google.com>
Fri, 16 Apr 2021 15:59:15 +0000 (11:59 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 21 Apr 2021 13:27:17 +0000 (13:27 +0000)
commit381252f312a513a969d9aa1d84cec2c9c1becf4d
treecd24dc6fc25be0f0c176a6d6b15204ec105b4350
parent5f1df260a91183c605c08af7b00741d2761b84e4
cmd/go/internal/modload: use updateRequirements instead of editRequirements to add modules for missing packages

editRequirements does a lot of work in order to respect the upper
bounds of mustSelect, and as a result it doesn't provide many promises
about conserving other things (like root dependencies).

When we add modules for missing packages, we aren't dealing with upper
bounds at all, so we would rather avoid the upper-bound overhead and
preserve the root-dependency invariants instead.
(*loader).updateRequirements does exactly that; it just needs to be
told about the additional dependencies to add.

For #36460

Change-Id: Ie0f2bc0dde18026bbd23e51357bb1d725d201680
Reviewed-on: https://go-review.googlesource.com/c/go/+/310791
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/load.go