Revive fixes - part 2#8835
Merged
ssoroka merged 8 commits intoinfluxdata:masterfrom Feb 16, 2021
zak-pawel:revive-fixes-part2
Merged
Revive fixes - part 2#8835ssoroka merged 8 commits intoinfluxdata:masterfrom zak-pawel:revive-fixes-part2
ssoroka merged 8 commits intoinfluxdata:masterfrom
zak-pawel:revive-fixes-part2
Conversation
[rule.if-return] [rule.increment-decrement] [rule.var-declaration] [rule.package-comments] [rule.receiver-naming] [rule.unexported-return]
srebhan
reviewed
Feb 8, 2021
srebhan
reviewed
Feb 8, 2021
srebhan
reviewed
Feb 8, 2021
srebhan
reviewed
Feb 8, 2021
srebhan
reviewed
Feb 8, 2021
srebhan
reviewed
Feb 8, 2021
Member
srebhan
left a comment
There was a problem hiding this comment.
Looks good, found only very minor things... ;-)
Regarding the renaming of the "class" variable I'm not so sure about the exceptions, but if everybody can live with it...
Collaborator
Author
|
For retry |
Collaborator
Author
|
For retry of windows tests |
ssoroka
reviewed
Feb 13, 2021
Contributor
|
I think there's still a lot of var struct/map/slice cases left over. I'm guessing we don't want to use |
Collaborator
Author
@ssoroka All var struct/map/slice cases reverted. |
ssoroka
approved these changes
Feb 16, 2021
arstercz
pushed a commit
to arstercz/telegraf
that referenced
this pull request
Mar 5, 2023
* Revive fixes regarding following set of rules: [rule.if-return] [rule.increment-decrement] [rule.var-declaration] [rule.package-comments] [rule.receiver-naming] [rule.unexported-return]
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
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.
Revive is fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
This is part2 of fixes for problems found for following set of rules:
i++andi--instead ofi += 1andi -= 1. -> By convention, for better readability, incrementing an integer variable by 1 is recommended to be done using the++operator. This rule spots expressions likei += 1andi -= 1and proposes to change them intoi++andi--.packagekeyword. More information hereParts,pis an adequate name for it. Contrary to other languages, it is not idiomatic to name receivers asthisorself.For changed files, minor fixes were also made (got rid off "log" package where it was easy, CamelCase instead of snake_case, etc...)