]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/modload: emit correct module in duplication error
authorBryan C. Mills <bcmills@google.com>
Thu, 9 Aug 2018 20:14:27 +0000 (16:14 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 9 Aug 2018 21:02:12 +0000 (21:02 +0000)
Updates #26904.

Change-Id: If7f381c3f3a41bd62c5f8bcf4f92720badcaf5c6
Reviewed-on: https://go-review.googlesource.com/128878
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/mod_replace.txt

index 63a17257b9d9944c0d8f3ddbe372d327087943bc..4e761af21c5856dd9917ee27996105248b2a803e 100644 (file)
@@ -140,7 +140,7 @@ func ImportPaths(args []string) []string {
                if prev, ok := firstPath[src]; !ok {
                        firstPath[src] = mod.Path
                } else if prev != mod.Path {
-                       base.Errorf("go: %s@%s used for two different module paths (%s and %s)", mod.Path, mod.Version, prev, mod.Path)
+                       base.Errorf("go: %s@%s used for two different module paths (%s and %s)", src.Path, src.Version, prev, mod.Path)
                }
        }
        base.ExitIfErrors()
index 799a7e82e907d46a342c113d3849aeda8f43729f..5894ed69f34178647a7dbf4e88ac851b05f0bf70 100644 (file)
@@ -20,7 +20,7 @@ stdout 'Clear is better than clever.'
 # However, the same module can't be used as two different paths.
 go mod edit -dropreplace=rsc.io/quote/v3 -replace=not-rsc.io/quote/v3@v3.0.0=rsc.io/quote/v3@v3.0.0 -require=not-rsc.io/quote/v3@v3.0.0
 ! go build -o a4.exe .
-
+stderr 'rsc.io/quote/v3@v3.0.0 used for two different module paths \(not-rsc.io/quote/v3 and rsc.io/quote/v3\)'
 
 -- go.mod --
 module quoter