1
0
mirror of https://github.com/golang/go synced 2024-09-23 15:20:13 -06:00

cmd/go/internal/modload: address comment and test issues from CL 496635

Michael noticed some minor issues in backports of CL 496635.
Those issues have been addressed in the backport CLs; this change
applies them to the main branch as well.

Updates #60313.

Change-Id: If68696711a10a9270193df66ed551395c14cae00
Reviewed-on: https://go-review.googlesource.com/c/go/+/502695
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Bryan C. Mills 2023-06-12 15:26:21 -04:00 committed by Gopher Robot
parent 962753b015
commit 992afd9d54
2 changed files with 4 additions and 8 deletions

View File

@ -916,7 +916,7 @@ func tidyPrunedRoots(ctx context.Context, mainModule module.Version, old *Requir
var disambiguateRoot sync.Map var disambiguateRoot sync.Map
for _, pkg := range pkgs { for _, pkg := range pkgs {
if pkg.mod.Path == "" || pathIsRoot[pkg.mod.Path] { if pkg.mod.Path == "" || pathIsRoot[pkg.mod.Path] {
// Lazy module loading will cause m to be checked before any other modules // Lazy module loading will cause pkg.mod to be checked before any other modules
// that are only indirectly required. It is as unambiguous as possible. // that are only indirectly required. It is as unambiguous as possible.
continue continue
} }

View File

@ -21,7 +21,7 @@ require example.net/outer/inner v0.1.0 // indirect
replace ( replace (
example.net/a v0.1.0 => ./a example.net/a v0.1.0 => ./a
example.net/b v0.1.0 => ./b example.net/b v0.1.0 => ./b
example.net/outer v0.1.0 => ./outer1 example.net/outer v0.1.0 => ./outer
example.net/outer/inner v0.1.0 => ./inner example.net/outer/inner v0.1.0 => ./inner
) )
-- example.go -- -- example.go --
@ -61,13 +61,9 @@ module example.net/outer/inner
go 1.21 go 1.21
-- inner/inner.go -- -- inner/inner.go --
package inner package inner
-- outer1/go.mod -- -- outer/go.mod --
module example.net/outer module example.net/outer
go 1.21 go 1.21
-- outer1/inner/inner.go -- -- outer/inner/inner.go --
package inner package inner
-- outer2/go.mod --
module example.net/outer
go 1.21