]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go/internal/modload: fix up main-module checks from CL 334932
authorBryan C. Mills <bcmills@google.com>
Mon, 29 Nov 2021 19:26:44 +0000 (14:26 -0500)
committerBryan C. Mills <bcmills@google.com>
Wed, 1 Dec 2021 15:43:08 +0000 (15:43 +0000)
commitab7905540bf83b85cdbd6574e54319126df9dae8
tree357d894dba1ca889868ce0afb10e996b9cbfefd9
parent0e1d553b4d98b71799b86b0ba9bc338de29b7dfe
cmd/go/internal/modload: fix up main-module checks from CL 334932

Some critical Version == "" checks were missing in mvs.go, causing
mvs.Req to fail to retain requirements provided by older versions of
main modules.

A few checks also ought to be rotated to put the less expensive
string-equality checks before the more expensive map lookups.

Fixes #48511

Change-Id: Ib8de9d49a6413660792c003866bfcf9ab7f82ee2
Reviewed-on: https://go-review.googlesource.com/c/go/+/368136
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/edit.go
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/modload/mvs.go
src/cmd/go/testdata/script/mod_get_issue48511.txt [new file with mode: 0644]