blob: e46f37d7fa287858299b0aa1f2c8c2d04621d255 (
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
68
69
70
71
72
73
74
75
|
# Regression test for https://golang.org/issue/34086:
# 'go mod tidy' produced different go.mod file from other
# subcommands when certain kinds of cycles were present
# in the build graph.
env GO111MODULE=on
cp go.mod go.mod.orig
go mod tidy
cmp go.mod go.mod.orig
# If the go.mod file is already tidy, 'go mod graph' should not modify it.
go mod graph
cmp go.mod go.mod.orig
-- go.mod --
module root
go 1.13
replace (
a v0.1.0 => ./a1
b v0.1.0 => ./b1
b v0.2.0 => ./b2
c v0.1.0 => ./c1
c v0.2.0 => ./c2
)
require (
a v0.1.0
b v0.2.0 // indirect
)
-- main.go --
package main
import _ "a"
func main() {}
-- a1/go.mod --
module a
go 1.13
require b v0.1.0
-- a1/a.go --
package a
import _ "c"
-- b1/go.mod --
module b
go 1.13
require c v0.1.0
-- b2/go.mod --
module b
go 1.13
require c v0.2.0
-- c1/go.mod --
module c
go 1.13
-- c2/c.go --
package c
-- c2/go.mod --
module c
go 1.13
require b v0.2.0
-- c2/c.go --
package c
|