-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Enable unparam linter; fix/mute existing warnings #3302
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
Merged
Merged
Conversation
This file contains hidden or 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
It is not used since commit e918d02. Signed-off-by: Kir Kolyshkin <[email protected]>
Since commit ff5075c it is no longer used. Signed-off-by: Kir Kolyshkin <[email protected]>
It was never used. Signed-off-by: Kir Kolyshkin <[email protected]>
Since commit eebdb64 this function never returns any error. Signed-off-by: Kir Kolyshkin <[email protected]>
It is not used since commit 00a0ecf. Signed-off-by: Kir Kolyshkin <[email protected]>
It is not and was not ever used. Signed-off-by: Kir Kolyshkin <[email protected]>
This function never returned anything other than nil, and its return value is discarded since it is only called from defer. Signed-off-by: Kir Kolyshkin <[email protected]>
This function has a return value for consistency, let it stay. Signed-off-by: Kir Kolyshkin <[email protected]>
Those were never used (ctx was added by the initial commit, and error was added by commit 25fd4a6). Signed-off-by: Kir Kolyshkin <[email protected]>
It never returns any error, so let's drop it (in case it needs to be re-added, it is easy to do so). Signed-off-by: Kir Kolyshkin <[email protected]>
Ignore the following warning: > libcontainer/cgroups/fs/blkio_test.go:167:78: `appendBlkioStatEntry` - `minor` always receives `0` (unparam) > func appendBlkioStatEntry(blkioStatEntries *[]cgroups.BlkioStatEntry, major, minor, value uint64, op string) { Signed-off-by: Kir Kolyshkin <[email protected]>
It is not and was never ever used. Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
AkihiroSuda
approved these changes
Nov 30, 2021
thaJeztah
approved these changes
Nov 30, 2021
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.
LGTM
if err := inheritStdio(process); err != nil { | ||
return nil, err | ||
} | ||
inheritStdio(process) |
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'm tempted to (for a follow-up) just get rid of the inheritStdio()
altogether, and just inline the code here;
Suggested change
inheritStdio(process) | |
process.Stdin = os.Stdin | |
process.Stdout = os.Stdout | |
process.Stderr = os.Stderr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It looks like unparam is a meaningful linter.
All commits except one are small and easy to review.