]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/modload: address comment and test issues from CL 496635
authorBryan C. Mills <bcmills@google.com>
Mon, 12 Jun 2023 19:26:21 +0000 (15:26 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 12 Jun 2023 19:42:01 +0000 (19:42 +0000)
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>

src/cmd/go/internal/modload/buildlist.go
src/cmd/go/testdata/script/mod_tidy_issue60313.txt

index 686c88652c8c8561150ecac3055891dfe0d165fc..8d3af0888cf0384e02a4fff0704708457b199405 100644 (file)
@@ -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
                        }
index cd704ce34c65d3ca36003a13e3c52a6481bd1f99..6963994cdfa69178038a6528910fad39640cdc2f 100644 (file)
@@ -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