summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/script/mod_vendor_unused.txt
blob: 96251bb25ae1bbc7cd72e60e93cae589d31f5733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Auxiliary test for inclusion of otherwise-unused replacements in
# vendor/modules.txt for golang.org/issue/33848.
# We need metadata about replacements in order to verify that modules.txt
# remains in sync with the main module's go.mod file.

env GO111MODULE=on

go mod vendor
cmp go1.14-modules.txt vendor/modules.txt

-- go.mod --
module example.com/foo
go 1.14

require (
	example.com/a v0.1.0
)

replace (
	example.com/a v0.1.0 => ./a
	example.com/b v0.1.0 => ./b1
	example.com/b v0.2.0-unused => ./b2
	example.com/c => ./c
	example.com/d v0.1.0 => ./d1
	example.com/d v0.2.0 => ./d2
	example.com/e => example.com/e v0.1.0-unused
)
-- foo.go --
package foo
import _ "example.com/a"
-- a/go.mod --
module example.com/a
require (
	example.com/b v0.1.0 // indirect
	example.com/c v0.1.0 // indirect
)
-- a/a.go --
package a
import _ "example.com/d"
-- b1/go.mod --
module example.com/b
require example.com/d v0.1.0
-- b2/go.mod --
module example.com/b
require example.com/c v0.2.0
-- c/go.mod --
module example.com/c
require example.com/d v0.2.0
-- d1/go.mod --
module example.com/d
-- d1/d1.go --
package d
-- d2/go.mod --
module example.com/d
-- d2/d2.go --
package d
-- go1.14-modules.txt --
# example.com/a v0.1.0 => ./a
## explicit
example.com/a
# example.com/d v0.2.0 => ./d2
example.com/d
# example.com/b v0.1.0 => ./b1
# example.com/b v0.2.0-unused => ./b2
# example.com/c => ./c
# example.com/d v0.1.0 => ./d1
# example.com/e => example.com/e v0.1.0-unused