...
1# Auxiliary test for inclusion of otherwise-unused replacements in
2# vendor/modules.txt for golang.org/issue/33848.
3# We need metadata about replacements in order to verify that modules.txt
4# remains in sync with the main module's go.mod file.
5
6env GO111MODULE=on
7
8go mod vendor
9cmp go1.14-modules.txt vendor/modules.txt
10
11-- go.mod --
12module example.com/foo
13go 1.14
14
15require (
16 example.com/a v0.1.0
17)
18
19replace (
20 example.com/a v0.1.0 => ./a
21 example.com/b v0.1.0 => ./b1
22 example.com/b v0.2.0-unused => ./b2
23 example.com/c => ./c
24 example.com/d v0.1.0 => ./d1
25 example.com/d v0.2.0 => ./d2
26 example.com/e => example.com/e v0.1.0-unused
27)
28-- foo.go --
29package foo
30import _ "example.com/a"
31-- a/go.mod --
32module example.com/a
33require (
34 example.com/b v0.1.0 // indirect
35 example.com/c v0.1.0 // indirect
36)
37-- a/a.go --
38package a
39import _ "example.com/d"
40-- b1/go.mod --
41module example.com/b
42require example.com/d v0.1.0
43-- b2/go.mod --
44module example.com/b
45require example.com/c v0.2.0
46-- c/go.mod --
47module example.com/c
48require example.com/d v0.2.0
49-- d1/go.mod --
50module example.com/d
51-- d1/d1.go --
52package d
53-- d2/go.mod --
54module example.com/d
55-- d2/d2.go --
56package d
57-- go1.14-modules.txt --
58# example.com/a v0.1.0 => ./a
59## explicit
60example.com/a
61# example.com/d v0.2.0 => ./d2
62example.com/d
63# example.com/b v0.1.0 => ./b1
64# example.com/b v0.2.0-unused => ./b2
65# example.com/c => ./c
66# example.com/d v0.1.0 => ./d1
67# example.com/e => example.com/e v0.1.0-unused
View as plain text