-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add golang-ci with errcheck enabled to test suite to ensure all errors produced are checked #1769
Conversation
|
Welcome @michaelasp! |
Hi @michaelasp. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/check-cla |
/ok-to-test |
ad9255f
to
9d13654
Compare
build/test.sh
Outdated
@@ -50,3 +50,16 @@ if [ -n "${ERRS}" ]; then | |||
fi | |||
echo "PASS" | |||
echo | |||
|
|||
echo -n "Checking errcheck: " | |||
go install github.com/kisielk/errcheck@latest 2>/dev/null |
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.
I see that it just tries to install errcheck "globally"
But I am curious, if this is the best approach, cause in main kubernetes repo, they using a separate go module, to keep track of such "utility" dependencies https://github.com/kubernetes/kubernetes/tree/master/hack/tools
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.
Mmm this may be a better way, especially if we plan to install more dependencies in the future. Let me look into this. Thanks for the suggestion!
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.
Done, very similar to how the kubernetes repo handles it. PTAL!
9d13654
to
ecf3b70
Compare
ecf3b70
to
195555f
Compare
hack/tools/tools.go
Outdated
@@ -0,0 +1,21 @@ | |||
/* | |||
Copyright 2019 The Kubernetes Authors. |
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.
nit: update to 2022
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.
Done
195555f
to
d8e55e0
Compare
d8e55e0
to
f02492a
Compare
1e774b0
to
76e5310
Compare
Works as intended with newest go version bump, @panslava @swetharepakula PTAL! |
Thank you, great job with CI! LGTM from me, but I want someone else to also take a look |
- fmt.Fprintf | ||
- fmt.Fprint | ||
- (net/http.ResponseWriter).Write | ||
- (*net/http.Server).Shutdown | ||
- (*flag.FlagSet).Parse | ||
- (*os.File).Close | ||
- (io.Closer).Close | ||
- (flag.Value).Set | ||
- k8s.io/apimachinery/pkg/util/wait.PollUntil |
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.
Should we have a task to also fix error handling for these functions?
Hi @michaelasp can you add 2-line README.md file to hack/tools
thanks |
76e5310
to
769baa9
Compare
Added readme and modified the go version to match the actual version. |
Thanks @michaelasp! This is a great addition! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: michaelasp, swetharepakula The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add the errcheck utility to check and see if there are any functions that produce an error which do not get checked after. Also fixes some issues related to this in sections, no functionality changes, we generally just log the error if it happens.