Skip to content

Commit

Permalink
Remove checked-in go.work, add generation
Browse files Browse the repository at this point in the history
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 golang/go#53502 for discussion on whether
or not go.work should be checked in.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
  • Loading branch information
SgtCoDFish authored and logand22 committed Mar 8, 2024
1 parent 8d7d158 commit 95d7756
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ _bin/
user.bazelrc
*.bak
/go.work.sum
**/go.work
12 changes: 0 additions & 12 deletions go.work

This file was deleted.

6 changes: 6 additions & 0 deletions make/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 95d7756

Please sign in to comment.