aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_get_issue47979.txt
blob: f5d4304ab2dcce46ebc4bea5d6c9fcd6a88110b4 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Regression test for https://golang.org/issue/47979:
#
# An argument to 'go get' that results in an upgrade to a different existing
# root should be allowed, and should not panic the 'go' command.

cp go.mod go.mod.orig


# Transitive upgrades from upgraded roots should not prevent
# 'go get -u' from performing upgrades.

cp go.mod.orig go.mod
go get -u -d .
cmp go.mod go.mod.want


# 'go get' of a specific version should allow upgrades of
# every dependency (transitively) required by that version,
# including dependencies that are pulled into the module
# graph by upgrading other root requirements
# (in this case, example.net/indirect).

cp go.mod.orig go.mod
go get -d example.net/a@v0.2.0
cmp go.mod go.mod.want


-- go.mod --
module golang.org/issue47979

go 1.17

replace (
	example.net/a v0.1.0 => ./a1
	example.net/a v0.2.0 => ./a2
	example.net/indirect v0.1.0 => ./indirect1
	example.net/indirect v0.2.0 => ./indirect2
	example.net/other v0.1.0 => ./other
	example.net/other v0.2.0 => ./other
)

require (
	example.net/a v0.1.0
	example.net/other v0.1.0
)

require example.net/indirect v0.1.0 // indirect
-- go.mod.want --
module golang.org/issue47979

go 1.17

replace (
	example.net/a v0.1.0 => ./a1
	example.net/a v0.2.0 => ./a2
	example.net/indirect v0.1.0 => ./indirect1
	example.net/indirect v0.2.0 => ./indirect2
	example.net/other v0.1.0 => ./other
	example.net/other v0.2.0 => ./other
)

require (
	example.net/a v0.2.0
	example.net/other v0.2.0
)

require example.net/indirect v0.2.0 // indirect
-- issue.go --
package issue

import _ "example.net/a"
-- useother/useother.go --
package useother

import _ "example.net/other"
-- a1/go.mod --
module example.net/a

go 1.17

require example.net/indirect v0.1.0
-- a1/a.go --
package a
-- a2/go.mod --
module example.net/a

go 1.17

require example.net/indirect v0.2.0
-- a2/a.go --
package a

import "example.net/indirect"
-- indirect1/go.mod --
module example.net/indirect

go 1.17

require example.net/other v0.1.0
-- indirect1/indirect.go --
package indirect
-- indirect2/go.mod --
module example.net/indirect

go 1.17

require example.net/other v0.2.0
-- indirect2/indirect.go --
package indirect

import "example.net/other"
-- other/go.mod --
module example.net/other

go 1.17
-- other/other.go --
package other