...
1[short] skip
2
3go mod download example.com/printversion@v0.1.0 example.com/printversion@v1.0.0
4go get example.com/printversion@v0.1.0
5go install example.com/printversion
6
7go run example.com/printversion
8cmp stdout out.txt
9
10go version -m $GOPATH/bin/printversion$GOEXE
11stdout '^.*[/\\]bin[/\\]printversion'$GOEXE': .*$'
12stdout '^ path example.com/printversion$'
13stdout '^ mod example.com/printversion v0.1.0$'
14stdout '^ => example.com/printversion v1.0.0 h1:.*$'
15stdout '^ dep example.com/version v1.0.0$'
16stdout '^ => example.com/version v1.0.1 h1:.*$'
17
18-- go.mod --
19module golang.org/issue/37392
20go 1.14
21require (
22 example.com/printversion v0.1.0
23)
24replace (
25 example.com/printversion => example.com/printversion v1.0.0
26 example.com/version v1.0.0 => example.com/version v1.0.1
27)
28-- out.txt --
29path is example.com/printversion
30main is example.com/printversion v0.1.0
31 (replaced by example.com/printversion v1.0.0)
32using example.com/version v1.0.0
33 (replaced by example.com/version v1.0.1)
View as plain text