...
1# If a replacement module declares a module path different from both
2# the original module and its location, report an error with all three paths.
3# In particular, the "required as" path should be the original.
4# Verifies golang.org/issue/38220.
5! go mod download
6cmp stderr want
7
8-- go.mod --
9module m
10
11require rsc.io/quote v1.5.2
12
13replace rsc.io/quote v1.5.2 => example.com/quote v1.5.2
14
15-- use.go --
16package use
17
18import _ "rsc.io/quote"
19
20-- want --
21go: rsc.io/quote@v1.5.2 (replaced by example.com/quote@v1.5.2): parsing go.mod:
22 module declares its path as: rsc.io/Quote
23 but was required as: rsc.io/quote
View as plain text