aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/init.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2021-04-16 11:59:15 -0400
committerBryan C. Mills <bcmills@google.com>2021-04-21 13:27:17 +0000
commit381252f312a513a969d9aa1d84cec2c9c1becf4d (patch)
treecd24dc6fc25be0f0c176a6d6b15204ec105b4350 /src/cmd/go/internal/modload/init.go
parent5f1df260a91183c605c08af7b00741d2761b84e4 (diff)
downloadgo-381252f312a513a969d9aa1d84cec2c9c1becf4d.tar.gz
go-381252f312a513a969d9aa1d84cec2c9c1becf4d.zip
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>
Diffstat (limited to 'src/cmd/go/internal/modload/init.go')
-rw-r--r--src/cmd/go/internal/modload/init.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go
index 238e471c54..4d240a7b64 100644
--- a/src/cmd/go/internal/modload/init.go
+++ b/src/cmd/go/internal/modload/init.go
@@ -691,7 +691,7 @@ func requirementsFromModFile(ctx context.Context, f *modfile.File) *Requirements
for _, n := range mPathCount {
if n > 1 {
var err error
- rs, err = updateRoots(ctx, rs.direct, rs)
+ rs, err = updateRoots(ctx, rs.direct, rs, nil)
if err != nil {
base.Fatalf("go: %v", err)
}