summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/script/work_replace_conflict.txt
blob: 81d1fcb04356b1902974a1cd3cefd42eca89439f (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
# Conflicting replaces in workspace modules returns error that suggests
# overriding it in the go.work file.

! go list -m example.com/dep
stderr 'go: conflicting replacements for example.com/dep@v1.0.0:\n\t./dep1\n\t./dep2\nuse "go work edit -replace example.com/dep@v1.0.0=\[override\]" to resolve'
go work edit -replace example.com/dep@v1.0.0=./dep1
go list -m example.com/dep
stdout 'example.com/dep v1.0.0 => ./dep1'

-- foo --
-- go.work --
use m
use n
-- m/go.mod --
module example.com/m

require example.com/dep v1.0.0
replace example.com/dep v1.0.0 => ./dep1
-- m/m.go --
package m

import "example.com/dep"

func F() {
	dep.G()
}
-- n/go.mod --
module example.com/n

require example.com/dep v1.0.0
replace example.com/dep v1.0.0 => ./dep2
-- n/n.go --
package n

import "example.com/dep"

func F() {
	dep.G()
}
-- dep1/go.mod --
module example.com/dep
-- dep1/dep.go --
package dep

func G() {
}
-- dep2/go.mod --
module example.com/dep
-- dep2/dep.go --
package dep

func G() {
}