From: Bryan C. Mills Date: Mon, 12 Jun 2023 19:26:21 +0000 (-0400) Subject: cmd/go/internal/modload: address comment and test issues from CL 496635 X-Git-Tag: go1.21rc1~29 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=992afd9d54e011355c18f4e0d3c14040a8d65053;p=gostls13.git 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 Auto-Submit: Bryan Mills Reviewed-by: Michael Matloob TryBot-Result: Gopher Robot --- diff --git a/src/cmd/go/internal/modload/buildlist.go b/src/cmd/go/internal/modload/buildlist.go index 686c88652c..8d3af0888c 100644 --- a/src/cmd/go/internal/modload/buildlist.go +++ b/src/cmd/go/internal/modload/buildlist.go @@ -916,7 +916,7 @@ func tidyPrunedRoots(ctx context.Context, mainModule module.Version, old *Requir var disambiguateRoot sync.Map for _, pkg := range pkgs { 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. continue } diff --git a/src/cmd/go/testdata/script/mod_tidy_issue60313.txt b/src/cmd/go/testdata/script/mod_tidy_issue60313.txt index cd704ce34c..6963994cdf 100644 --- a/src/cmd/go/testdata/script/mod_tidy_issue60313.txt +++ b/src/cmd/go/testdata/script/mod_tidy_issue60313.txt @@ -21,7 +21,7 @@ require example.net/outer/inner v0.1.0 // indirect replace ( example.net/a v0.1.0 => ./a 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.go -- @@ -61,13 +61,9 @@ module example.net/outer/inner go 1.21 -- inner/inner.go -- package inner --- outer1/go.mod -- +-- outer/go.mod -- module example.net/outer go 1.21 --- outer1/inner/inner.go -- +-- outer/inner/inner.go -- package inner --- outer2/go.mod -- -module example.net/outer - -go 1.21