Skip to content

Commit 992afd9

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
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 <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Michael Matloob <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 962753b commit 992afd9

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/cmd/go/internal/modload/buildlist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ func tidyPrunedRoots(ctx context.Context, mainModule module.Version, old *Requir
916916
var disambiguateRoot sync.Map
917917
for _, pkg := range pkgs {
918918
if pkg.mod.Path == "" || pathIsRoot[pkg.mod.Path] {
919-
// Lazy module loading will cause m to be checked before any other modules
919+
// Lazy module loading will cause pkg.mod to be checked before any other modules
920920
// that are only indirectly required. It is as unambiguous as possible.
921921
continue
922922
}

src/cmd/go/testdata/script/mod_tidy_issue60313.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require example.net/outer/inner v0.1.0 // indirect
2121
replace (
2222
example.net/a v0.1.0 => ./a
2323
example.net/b v0.1.0 => ./b
24-
example.net/outer v0.1.0 => ./outer1
24+
example.net/outer v0.1.0 => ./outer
2525
example.net/outer/inner v0.1.0 => ./inner
2626
)
2727
-- example.go --
@@ -61,13 +61,9 @@ module example.net/outer/inner
6161
go 1.21
6262
-- inner/inner.go --
6363
package inner
64-
-- outer1/go.mod --
64+
-- outer/go.mod --
6565
module example.net/outer
6666

6767
go 1.21
68-
-- outer1/inner/inner.go --
68+
-- outer/inner/inner.go --
6969
package inner
70-
-- outer2/go.mod --
71-
module example.net/outer
72-
73-
go 1.21

0 commit comments

Comments
 (0)