blob: a7661b68ad400c025377ae80bfb28e17dda59097 (
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
|
# This test makes checks against a regression of a bug in the Go command
# where the module loader hung forever because all main module dependencies
# kept workspace pruning instead of adopting the pruning in their go.mod
# files, and the loader kept adding dependencies on the queue until they
# were either pruned or unpruned, never breaking a module dependency cycle.
#
# This is the module graph in the test:
#
# /-------------------------\
# | |
# V |
# example.com/a -> example.com/b v1.0.0 -> example.com/c v1.1.0
go list -m -f '{{.Version}}' example.com/c
-- go.work --
go 1.16
use (
./a
)
-- a/go.mod --
module example.com/a
go 1.18
require example.com/b v1.0.0
replace example.com/b v1.0.0 => ../b
replace example.com/c v1.0.0 => ../c
-- a/foo.go --
package main
import "example.com/b"
func main() {
b.B()
}
-- b/go.mod --
module example.com/b
go 1.18
require example.com/c v1.0.0
-- b/b.go --
package b
func B() {
}
-- b/cmd/main.go --
package main
import "example.com/c"
func main() {
c.C()
}
-- c/go.mod --
module example.com/c
go 1.18
require example.com/b v1.0.0
-- c/c.go --
package c
import "example.com/b"
func C() {
b.B()
}
|