From 95d7756d5cbc499ca38185b0ae5839f31ceaf38f Mon Sep 17 00:00:00 2001 From: Ashley Davis Date: Tue, 11 Apr 2023 12:03:00 +0100 Subject: [PATCH] Remove checked-in go.work, add generation go.work is not respected by imports, which means that our test environment - if it uses go.work - will differ from what'll be used by third parties which import our core module. This commit adds a generation target for go.work which will allow users to opt-in to using it locally without it being enabled by default for everyone. See https://github.com/golang/go/issues/53502 for discussion on whether or not go.work should be checked in. Signed-off-by: Ashley Davis --- .gitignore | 1 + go.work | 12 ------------ make/tools.mk | 6 ++++++ 3 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 go.work diff --git a/.gitignore b/.gitignore index 8693bfbe994..e3e4048df8e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ _bin/ user.bazelrc *.bak /go.work.sum +**/go.work diff --git a/go.work b/go.work deleted file mode 100644 index da35b899b5d..00000000000 --- a/go.work +++ /dev/null @@ -1,12 +0,0 @@ -go 1.20 - -use ( - . - ./cmd/acmesolver - ./cmd/cainjector - ./cmd/controller - ./cmd/ctl - ./cmd/webhook - ./test/e2e - ./test/integration -) diff --git a/make/tools.mk b/make/tools.mk index b196d57c69a..be3167c5aca 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -467,3 +467,9 @@ tidy: cd cmd/webhook && go mod tidy cd test/integration && go mod tidy cd test/e2e && go mod tidy + +.PHONY: go-workspace +go-workspace: + @rm -f go.work + go work init + go work use . ./cmd/acmesolver ./cmd/cainjector ./cmd/controller ./cmd/ctl ./cmd/webhook ./test/integration ./test/e2e