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 <ashley.davis@jetstack.io>
This commit is contained in:
Ashley Davis 2023-04-11 12:03:00 +01:00
parent 094ff99da1
commit c8d6596e47
No known key found for this signature in database
GPG Key ID: DD14CC017E32BEB1
3 changed files with 7 additions and 12 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@ _bin/
user.bazelrc
*.bak
/go.work.sum
**/go.work

12
go.work
View File

@ -1,12 +0,0 @@
go 1.20
use (
.
./cmd/acmesolver
./cmd/cainjector
./cmd/controller
./cmd/ctl
./cmd/webhook
./test/e2e
./test/integration
)

View File

@ -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