-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: enable unused-receiver from revive #1883
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
Conversation
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
b27a750
to
beb38f6
Compare
disk/disk_freebsd.go
Outdated
@@ -19,7 +19,7 @@ import ( | |||
|
|||
// PartitionsWithContext returns disk partition. | |||
// 'all' argument is ignored, see: https://github.com/giampaolo/psutil/issues/906 |
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 feel like a comment like this one should be provided for all functions you are updating.
Having -withcontext functions that ignore context sounds a bug.
I'm fine with the changes, I understand them. But it's end to something strange.
I feel like a comment like
- this function complies the interface/signature, unfortunately this os doesn't support context
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.
Another way to consider the change would be to check the context and return ctx.Error
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 for the PR. I agree that it's certainly possible to remove the variable name definitions. However, as mentioned in the comment, gopsutil needs to use the same function signatures across all platforms. Because of that, it's inevitable that some variables won't be used on certain platforms. I personally think it's better to explicitly use |
Alright, I'll just drop the second commit then |
beb38f6
to
5ba7e2e
Compare
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.
OK. thank you for your update.
Description
Enable unused-receiver from revive. It removes names for unused receivers.