Skip to content

Commit

Permalink
cmd/go/internal/modload: emit correct module in duplication error
Browse files Browse the repository at this point in the history
Updates #26904.

Change-Id: If7f381c3f3a41bd62c5f8bcf4f92720badcaf5c6
Reviewed-on: https://go-review.googlesource.com/128878
Reviewed-by: Russ Cox <rsc@golang.org>
  • Loading branch information
Bryan C. Mills committed Aug 9, 2018
1 parent 5b56053 commit 3cb64ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd/go/internal/modload/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go/testdata/script/mod_replace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3cb64ea

Please sign in to comment.