-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Go workspace #19314
Closed
Closed
Enable Go workspace #19314
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
da1b47a
Enable Go workspace
ivanvc c0206ac
Add verify-go-workspace make target
ivanvc 697abcf
Migrate verify-go-versions to use the Go workspace
ivanvc 0a0d565
Migrate verify-lint to use the Go workspace
ivanvc 0a94f9d
Migrate verify-gofmt make target to use the Go workspace
ivanvc f2a0ee4
Migrate verify-bom make target to use the Go workspace
ivanvc 601ba5e
Migrate verify-goword make target to use the Go workspace
ivanvc 0d2f05c
Migrate verify-license-header make target to use the Go workspace
ivanvc dad115f
Migrate verify-govet make target to use the Go workspace
ivanvc 4d43c75
Migrate verify-mod-tidy make target to use the Go workspace
ivanvc ae4d6a3
Migrate verify-govet-shadow make target to use the Go workspace
ivanvc 8b3f523
Migrate release scripts to use the Go workspace
ivanvc c342fc6
Migrate updatebom.sh to use the Go workspace
ivanvc 0e05186
Migrate scripts/fix.sh to use the Go workspace
ivanvc 73bb43f
Migrate run-govulncheck to use the Go workspace
ivanvc 23ae621
Migrate build script to use the Go workspace
ivanvc d7ff06d
Migrate tests to use the Go workspace
ivanvc 3be8aba
Migrate cov make target to use the Go workspace
ivanvc 277ffd7
Migrate sync-toolchain-directive make target to use the Go workspace
ivanvc a639591
Migrate fix-yamllint to use the Go workspace
ivanvc 9396f68
Migrate robustness makefile to use the Go workspace
ivanvc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// This is a generated file. Do not edit directly. | ||
|
||
go 1.23 | ||
|
||
toolchain go1.23.5 | ||
|
||
use ( | ||
. | ||
./api | ||
./client/internal/v2 | ||
./client/pkg | ||
./client/v3 | ||
./etcdctl | ||
./etcdutl | ||
./pkg | ||
./server | ||
./tests | ||
./tools/mod | ||
./tools/rw-heatmaps | ||
./tools/testgrid-analysis | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why v3.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I don't see a need to change
./FORBIDDEN_DEPENDENCY
to../FORBIDDEN_DEPENDENCY
, although not very important.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the workspace to work, dependencies need to be consistent. The problem is that we have the same dependency used and also in a replacement for the forbidden dependencies, then go complains with the following error:
It could technically be anything, but if we set it to a version like 3.6.0, we would need to change that when we release the 3.6.0 version.
In my first attempt to enable the Go workspace, I couldn't figure out why the forbidden dependency trick wasn't working. I removed it and implemented how
k/k
does the forbidden dependencies. However, Tim pointed out that it works if you point this virtual dependency to the exact location across the different submodules. So, the top-level points them to./FORBIDDEN_DEPENDENCY,
for the first-level (i.e.,./api
), it should point to../FORBIDDEN_DEPENDENCY
and so on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does K8s implement the forbidden dependencies? I don't see any forbidden directive in K8s's go.mod files at all.
Even if we use "v3.0.0", we also need to manually update it when we release new major release, i.e. v4.0.0, but it's less frequent.
Can we raise a question in golang community to ask for best practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They use an internal tool import-boss, which works with .import-restrictions files.