Skip to content

Commit 6544f41

Browse files
ivanvcthockin
andcommitted
Enable Go workspace
Introduce a new Go workspace that references all the current submodules. To preserve the current behavior, point all of the current FORBIDDEN_DEPENCENCY virtual dependencies to the same path. Add scripts/update_go_workspace.sh that generates the Go workspace file (go.work) based on the submodules found in the project (excluding the tools) and creates the go.work.sum file after running go mod download. Added this script to the fix Makefile target. Even though, the number of modules in the etcd repository is small, by adding an automated way of updating the go.work modules future proofs the project in case there are new modules or removal of them. Point all forbidden dependencies to a common virtual place (top-level FORBIDDEN_DEPENDENCY). For the workspace to function we need all dependencies to be consistent across the repository. That means that the current approach with FORBIDDEN_DEPENDENCY doesn't work, because they are pointing to different directories. Set the fictional v3.999.999 version for these dependencies, so they are consitent, and they don't clash with the actual depdendencies references in other modules. Co-authored-by: Tim Hockin <[email protected]> Signed-off-by: Ivan Valdes <[email protected]>
1 parent d486871 commit 6544f41

File tree

11 files changed

+194
-27
lines changed

11 files changed

+194
-27
lines changed

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ verify: verify-gofmt verify-bom verify-lint verify-dep verify-shellcheck verify-
8080
verify-govet-shadow verify-markdown-marker verify-go-versions
8181

8282
.PHONY: fix
83-
fix: fix-bom fix-lint fix-yamllint sync-toolchain-directive
83+
fix: fix-bom fix-lint fix-yamllint sync-toolchain-directive update-go-workspace
8484
./scripts/fix.sh
8585

8686
.PHONY: verify-gofmt
@@ -224,3 +224,7 @@ sync-toolchain-directive:
224224
.PHONY: markdown-diff-lint
225225
markdown-diff-lint:
226226
./scripts/markdown_diff_lint.sh
227+
228+
.PHONY: update-go-workspace
229+
update-go-workspace:
230+
./scripts/update_go_workspace.sh

api/go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ require (
3131
// Bad imports are sometimes causing attempts to pull that code.
3232
// This makes the error more explicit.
3333
replace (
34-
go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
35-
go.etcd.io/etcd/api/v3 => ./FORBIDDEN_DEPENDENCY
36-
go.etcd.io/etcd/pkg/v3 => ./FORBIDDEN_DEPENDENCY
37-
go.etcd.io/etcd/tests/v3 => ./FORBIDDEN_DEPENDENCY
38-
go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
34+
go.etcd.io/etcd => ../FORBIDDEN_DEPENDENCY
35+
go.etcd.io/etcd/api/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
36+
go.etcd.io/etcd/pkg/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
37+
go.etcd.io/etcd/tests/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
38+
go.etcd.io/etcd/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
3939
)

client/internal/v2/go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ replace (
2727
// Bad imports are sometimes causing attempts to pull that code.
2828
// This makes the error more explicit.
2929
replace (
30-
go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
31-
go.etcd.io/etcd/pkg/v3 => ./FORBIDDED_DEPENDENCY
32-
go.etcd.io/etcd/tests/v3 => ./FORBIDDEN_DEPENDENCY
33-
go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
30+
go.etcd.io/etcd => ../../../FORBIDDEN_DEPENDENCY
31+
go.etcd.io/etcd/pkg/v3 v3.999.999 => ../../../FORBIDDEN_DEPENDENCY
32+
go.etcd.io/etcd/tests/v3 v3.999.999 => ../../../FORBIDDEN_DEPENDENCY
33+
go.etcd.io/etcd/v3 v3.999.999 => ../../../FORBIDDEN_DEPENDENCY
3434
)

client/v3/go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ replace (
5252
// Bad imports are sometimes causing attempts to pull that code.
5353
// This makes the error more explicit.
5454
replace (
55-
go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
56-
go.etcd.io/etcd/pkg/v3 => ./FORBIDDEN_DEPENDENCY
57-
go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
58-
go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
55+
go.etcd.io/etcd => ../../FORBIDDEN_DEPENDENCY
56+
go.etcd.io/etcd/pkg/v3 v3.999.999 => ../../FORBIDDEN_DEPENDENCY
57+
go.etcd.io/etcd/v3 v3.999.999 => ../../FORBIDDEN_DEPENDENCY
58+
go.etcd.io/tests/v3 v3.999.999 => ../../FORBIDDEN_DEPENDENCY
5959
)

etcdctl/go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ replace (
5656
// Bad imports are sometimes causing attempts to pull that code.
5757
// This makes the error more explicit.
5858
replace (
59-
go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
60-
go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
61-
go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
59+
go.etcd.io/etcd => ../FORBIDDEN_DEPENDENCY
60+
go.etcd.io/etcd/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
61+
go.etcd.io/tests/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
6262
)

etcdutl/go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ replace (
1616
// Bad imports are sometimes causing attempts to pull that code.
1717
// This makes the error more explicit.
1818
replace (
19-
go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
20-
go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
21-
go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
19+
go.etcd.io/etcd => ../FORBIDDEN_DEPENDENCY
20+
go.etcd.io/etcd/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
21+
go.etcd.io/tests/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
2222
)
2323

2424
require (

go.work

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This is a generated file. Do not edit directly.
2+
3+
go 1.24
4+
5+
toolchain go1.24.1
6+
7+
use (
8+
.
9+
./api
10+
./client/internal/v2
11+
./client/pkg
12+
./client/v3
13+
./etcdctl
14+
./etcdutl
15+
./pkg
16+
./server
17+
./tests
18+
)

go.work.sum

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20230802163732-1c33ebd9ecfa.1 h1:tdpHgTbmbvEIARu+bixzmleMi14+3imnpoFXz+Qzjp4=
2+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20230802163732-1c33ebd9ecfa.1/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew=
3+
cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4=
4+
cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
5+
cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=
6+
cloud.google.com/go/compute v1.23.4 h1:EBT9Nw4q3zyE7G45Wvv3MzolIrCJEuHys5muLY0wvAw=
7+
cloud.google.com/go/compute v1.23.4/go.mod h1:/EJMj55asU6kAFnuZET8zqgwgJ9FvXWXOkkfQZa4ioI=
8+
cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I=
9+
cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
10+
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
11+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw=
12+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM=
13+
github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=
14+
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
15+
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
16+
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
17+
github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=
18+
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
19+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9 h1:goHVqTbFX3AIo0tzGr14pgfAW2ZfPChKO21Z9MGf/gk=
20+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
21+
github.com/bufbuild/protovalidate-go v0.2.1 h1:pJr07sYhliyfj/STAM7hU4J3FKpVeLVKvOBmOTN8j+s=
22+
github.com/bufbuild/protovalidate-go v0.2.1/go.mod h1:e7XXDtlxj5vlEyAgsrxpzayp4cEMKCSSb8ZCkin+MVA=
23+
github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=
24+
github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
25+
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=
26+
github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 h1:boJj011Hh+874zpIySeApCX4GeOjPl9qhRF3QuIZq+Q=
27+
github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
28+
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
29+
github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M=
30+
github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA=
31+
github.com/envoyproxy/go-control-plane/envoy v1.32.4 h1:jb83lalDRZSpPWW2Z7Mck/8kXZ5CQAFYVjQcdVIr83A=
32+
github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw=
33+
github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI=
34+
github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4=
35+
github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8=
36+
github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU=
37+
github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=
38+
github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=
39+
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
40+
github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=
41+
github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc=
42+
github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
43+
github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=
44+
github.com/google/cel-go v0.17.1 h1:s2151PDGy/eqpCI80/8dl4VL3xTkqI/YubXLXCFw0mw=
45+
github.com/google/cel-go v0.17.1/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY=
46+
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
47+
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
48+
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
49+
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
50+
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
51+
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
52+
github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=
53+
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
54+
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
55+
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
56+
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
57+
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
58+
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
59+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
60+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
61+
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
62+
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
63+
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
64+
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
65+
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
66+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
67+
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
68+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
69+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
70+
github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=
71+
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
72+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
73+
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
74+
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
75+
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
76+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
77+
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
78+
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
79+
github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM=
80+
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 h1:JRxssobiPg23otYU5SbWtQC//snGVIM3Tx6QRzlQBao=
81+
go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo=
82+
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
83+
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
84+
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
85+
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=
86+
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
87+
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
88+
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
89+
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
90+
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
91+
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
92+
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
93+
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
94+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
95+
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
96+
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
97+
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215 h1:0Uz5jLJQioKgVozXa1gzGbzYxbb/rhQEVvSWxzw5oUs=
98+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
99+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
100+
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs=

pkg/go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ replace go.etcd.io/etcd/client/pkg/v3 => ../client/pkg
3939
// Etcd contains lots of packages and dependency relationship.
4040
// Shouldn't import unnecessary dependencies
4141
replace (
42-
go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
43-
go.etcd.io/etcd/api/v3 => ./FORBIDDEN_DEPENDENCY
44-
go.etcd.io/etcd/tests/v3 => ./FORBIDDEN_DEPENDENCY
45-
go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
42+
go.etcd.io/etcd => ../FORBIDDEN_DEPENDENCY
43+
go.etcd.io/etcd/api/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
44+
go.etcd.io/etcd/tests/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
45+
go.etcd.io/etcd/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
4646
)

scripts/update_go_workspace.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2024 The etcd Authors
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Based on k/k scripts/update-go-workspace.sh:
18+
# https://github.com/kubernetes/kubernetes/blob/e2b96b25661849775dedf441b2f5c555392caa84/hack/update-go-workspace.sh
19+
20+
# This script generates go.work so that it includes all Go packages
21+
# in this repo, with a few exceptions.
22+
23+
set -euo pipefail
24+
25+
source ./scripts/test_lib.sh
26+
27+
# Avoid issues and remove the workspace files.
28+
rm -f go.work go.work.sum
29+
30+
# Generate the workspace.
31+
go work init
32+
sed -i -e '1i\// This is a generated file. Do not edit directly.\n' go.work
33+
34+
# Include all submodules from the repository, but skip modules inside the tools
35+
# directory.
36+
git ls-files -z ':(glob)**/go.mod' ':!/tools/*' \
37+
| xargs -0 -n1 dirname -z \
38+
| xargs -0 -n1 go work edit -use
39+
40+
go work edit -toolchain "go$(cat .go-version)"
41+
go work edit -go "$(go mod edit -json | jq -r .Go)"
42+
43+
# generate go.work.sum
44+
go mod download

server/go.mod

+4-3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ replace (
8989

9090
// Bad imports are sometimes causing attempts to pull that code.
9191
// This makes the error more explicit.
92-
replace go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
93-
94-
replace go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
92+
replace (
93+
go.etcd.io/etcd => ../FORBIDDEN_DEPENDENCY
94+
go.etcd.io/tests/v3 v3.999.999 => ../FORBIDDEN_DEPENDENCY
95+
)

0 commit comments

Comments
 (0)