...
1# Regression test for https://golang.org/issue/48511:
2# requirement minimization was accidentally replacing previous
3# versions of the main module, causing dependencies to be
4# spuriously dropping during requirement minimization and
5# leading to an infinite loop.
6
7cp go.mod go.mod.orig
8go mod tidy
9cmp go.mod go.mod.orig
10
11go get -u=patch ./...
12cmp go.mod go.mod.want
13
14-- go.mod --
15module example.net/m
16
17go 1.16
18
19replace (
20 example.net/a v0.1.0 => ./a
21 example.net/b v0.1.0 => ./b
22 example.net/b v0.1.1 => ./b
23 example.net/m v0.1.0 => ./m1
24)
25
26require example.net/a v0.1.0
27-- go.mod.want --
28module example.net/m
29
30go 1.16
31
32replace (
33 example.net/a v0.1.0 => ./a
34 example.net/b v0.1.0 => ./b
35 example.net/b v0.1.1 => ./b
36 example.net/m v0.1.0 => ./m1
37)
38
39require (
40 example.net/a v0.1.0
41 example.net/b v0.1.1 // indirect
42)
43-- m.go --
44package m
45
46import "example.net/a"
47-- m1/go.mod --
48module example.net/m
49
50go 1.16
51
52require example.net/b v0.1.0
53-- a/go.mod --
54module example.net/a
55
56go 1.16
57
58require example.net/m v0.1.0
59-- a/a.go --
60package a
61
62import "example.net/b"
63-- b/go.mod --
64module example.net/b
65
66go 1.16
67-- b/b.go --
68package b
View as plain text