...
1env GO111MODULE=on
2
3# golang.org/issue/31248: loading the build list must not add explicit entries
4# for indirect dependencies already implied by older-than-selected versions
5# already in the build list.
6
7cp go.mod.orig go.mod
8go mod tidy
9cmp go.mod go.mod.orig
10
11cp go.mod.orig go.mod
12go list -m all
13cmp go.mod go.mod.orig
14
15-- go.mod.orig --
16module main
17
18go 1.13
19
20require a v0.0.0
21
22replace (
23 a v0.0.0 => ./a
24 b v0.0.0 => ./b
25 i v0.0.0 => ./i
26 x v0.1.0 => ./x1
27 x v0.2.0 => ./x2
28)
29-- main.go --
30package main
31
32import _ "a"
33
34func main() {}
35-- a/go.mod --
36module a
37go 1.13
38require (
39 x v0.2.0
40 b v0.0.0
41)
42-- a/a.go --
43package a
44-- b/go.mod --
45module b
46go 1.13
47require x v0.1.0
48-- x1/go.mod --
49module x
50go 1.13
51require (
52 b v0.0.0
53 i v0.0.0
54)
55-- x2/go.mod --
56module x
57go 1.13
58-- i/go.mod --
59module i
60go 1.13
View as plain text