-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Remove always-nil error returns #36910
Conversation
/test |
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!
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.
Just a question for my own curiosity, otherwise lgtm
a992790
to
d8aa0e3
Compare
/test |
These errors are always nil, so they can be omitted and get rid of the respective error checking code. Found using unparam. Note that we cannot enable the unparam linter yet in golangci-lint because there are some false positives. Signed-off-by: Tobias Klauser <tobias@cilium.io>
d8aa0e3
to
7a193c6
Compare
Fixed up #36910 (comment) and a comment in Incremental diff: diff --git a/daemon/cmd/deletion_queue.go b/daemon/cmd/deletion_queue.go
index 3724b4a01e43..44687c98a053 100644
--- a/daemon/cmd/deletion_queue.go
+++ b/daemon/cmd/deletion_queue.go
@@ -44,7 +44,6 @@ func (dq *deletionQueue) Start(cell.HookContext) error {
}
if err := dq.lock(d.ctx); err != nil {
- log.WithError(err).Error("deletionQueue: lock failed")
return
}
@@ -77,8 +76,8 @@ func (dq *deletionQueue) lock(ctx context.Context) error {
return err
}
- // Don't a non-nil return error from here on so successive dq.processQueuedDeletes can still
- // continue with best effort.
+ // Don't return a non-nil error from here on so a successive call to dq.processQueuedDeletes
+ // can still continue with best effort.
var err error
dq.lf, err = lockfile.NewLockfile(defaults.DeleteQueueLockfile)
if err != nil { |
/test |
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.
Looks good for my codeowners, thanks!
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!
These errors are always nil, so they can be omitted and get rid of the respective error checking code. Found using
unparam
. Note that we cannot enable theunparam
linter yet ingolangci-lint
because there are some false positives.