-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[v1.14] golangci: Enable errorlint #31793
Merged
Merged
Conversation
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
jrajahalme
added
kind/backports
This PR provides functionality previously merged into master.
backport/1.14
This PR represents a backport for Cilium 1.14.x of a PR that was merged to main.
labels
Apr 5, 2024
/test-backport-1.14 |
jrajahalme
force-pushed
the
fix-error-wrapping-1.14
branch
from
April 5, 2024 13:55
88ea980
to
9e94a29
Compare
/test-backport-1.14 |
learnitall
approved these changes
Apr 11, 2024
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.
Thanks!
glibsm
approved these changes
Apr 16, 2024
'make lint' fails like this: docker run --rm -v `pwd`:/app -w /app docker.io/golangci/golangci-lint:v1.53.3@sha256:1e0e2867b387bf68762427db499a963e43582b06819992db205fc31daa75ceea golangci-lint run level=error msg="Running error: context loading failed: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: go: errors parsing go.mod:\n/app/go.mod:4: invalid go version '1.21.0': must match format 1.23\n" make: *** [Makefile:424: golangci-lint] Error 3 This is due to a too old Go version within the golangci-lint v1.53.3 image: $ docker run --rm -v `pwd`:/app -w /app docker.io/golangci/golangci-lint:v1.53.3@sha256:1e0e2867b387bf68762427db499a963e43582b06819992db205fc31daa75ceea go version go version go1.20.5 linux/arm64 Fix by using the same golangci-lint version for `make lint` as we already use for the GH Go lint action. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
[ upstream commit d20f15e ] Enable errorlint in golangci-lint to catch uses of improper formatters for Go errors. This helps avoid unnecessary error/warning logs that cause CI flakes, when benign error cases are not caught due to failing error unwrapping when a string or value formatter has been used instead of the dedicated `%w`. Related: #31147 Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
[ upstream commit fe46958 ] Precede each `%w` formatter with a colon. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
jrajahalme
force-pushed
the
fix-error-wrapping-1.14
branch
from
April 16, 2024 18:18
9e94a29
to
4a96640
Compare
rebased & resolved conflicts |
/test-backport-1.14 |
michi-covalent
approved these changes
Apr 17, 2024
aditighag
approved these changes
Apr 17, 2024
maintainer-s-little-helper
bot
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Apr 17, 2024
This was referenced Apr 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport/1.14
This PR represents a backport for Cilium 1.14.x of a PR that was merged to main.
kind/backports
This PR provides functionality previously merged into master.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
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.
Note: Added commit updating golangci-lint version used by
make lint
to match that of the GH Go lint action.Once this PR is merged, a GitHub action will update the labels of these PRs: