1 go work sync
2 cmp a/go.mod a/want_go.mod
3 cmp b/go.mod b/want_go.mod
4
5 -- go.work --
6 go 1.18
7
8 use (
9 ./a
10 ./b
11 )
12
13 -- a/go.mod --
14 go 1.18
15
16 module example.com/a
17
18 require (
19 example.com/p v1.0.0
20 example.com/q v1.1.0
21 example.com/r v1.0.0
22 )
23
24 replace (
25 example.com/p => ../p
26 example.com/q => ../q
27 example.com/r => ../r
28 )
29 -- a/want_go.mod --
30 go 1.18
31
32 module example.com/a
33
34 require (
35 example.com/p v1.1.0
36 example.com/q v1.1.0
37 )
38
39 replace (
40 example.com/p => ../p
41 example.com/q => ../q
42 example.com/r => ../r
43 )
44 -- a/a.go --
45 package a
46
47 import (
48 "example.com/p"
49 "example.com/q"
50 )
51
52 func Foo() {
53 p.P()
54 q.Q()
55 }
56 -- b/go.mod --
57 go 1.18
58
59 module example.com/b
60
61 require (
62 example.com/p v1.1.0
63 example.com/q v1.0.0
64 )
65
66 replace (
67 example.com/p => ../p
68 example.com/q => ../q
69 )
70 -- b/want_go.mod --
71 go 1.18
72
73 module example.com/b
74
75 require (
76 example.com/p v1.1.0
77 example.com/q v1.1.0
78 )
79
80 replace (
81 example.com/p => ../p
82 example.com/q => ../q
83 )
84 -- b/b.go --
85 package b
86
87 import (
88 "example.com/p"
89 "example.com/q"
90 )
91
92 func Foo() {
93 p.P()
94 q.Q()
95 }
96 -- p/go.mod --
97 go 1.18
98
99 module example.com/p
100 -- p/p.go --
101 package p
102
103 func P() {}
104 -- q/go.mod --
105 go 1.18
106
107 module example.com/q
108 -- q/q.go --
109 package q
110
111 func Q() {}
112 -- r/go.mod --
113 go 1.18
114
115 module example.com/r
116 -- r/q.go --
117 package r
118
119 func R() {}
View as plain text