Revive fixes - part 1#8797
Merged
ssoroka merged 4 commits intoinfluxdata:masterfrom Feb 8, 2021
zak-pawel:revive-fixes-part1
Merged
Revive fixes - part 1#8797ssoroka merged 4 commits intoinfluxdata:masterfrom zak-pawel:revive-fixes-part1
ssoroka merged 4 commits intoinfluxdata:masterfrom
zak-pawel:revive-fixes-part1
Conversation
[rule.blank-imports] [rule.context-as-argument] [rule.context-keys-type] [rule.dot-imports] [rule.error-return] [rule.error-strings] [rule.indent-error-flow] [rule.errorf]
srebhan
reviewed
Feb 4, 2021
plugins/inputs/jti_openconfig_telemetry/openconfig_telemetry.go
Outdated
Show resolved
Hide resolved
srebhan
reviewed
Feb 4, 2021
srebhan
reviewed
Feb 4, 2021
Member
srebhan
left a comment
There was a problem hiding this comment.
Wow that was a ride. :-)
The code looks good to me. I found one more superfluous else in plugins/inputs/jti_openconfig_telemetry/openconfig_telemetry.go line 308. Please fix this one also.
I also found plugins/outputs/amqp/amqp.go using the log package instead of telegraf.Logger but that might be a separate bunch of changes...
srebhan
approved these changes
Feb 4, 2021
Member
srebhan
left a comment
There was a problem hiding this comment.
Perfect! Thank you very much!
ssoroka
approved these changes
Feb 5, 2021
Contributor
ssoroka
left a comment
There was a problem hiding this comment.
Amazing effort. minor feedback.
ssoroka
approved these changes
Feb 8, 2021
arstercz
pushed a commit
to arstercz/telegraf
that referenced
this pull request
Mar 5, 2023
* Revive fixes regarding following set of rules: [rule.blank-imports] [rule.context-as-argument] [rule.context-keys-type] [rule.dot-imports] [rule.error-return] [rule.error-strings] [rule.indent-error-flow] [rule.errorf]
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 part1 of fixes for problems found for following set of rules:
context.Contextshould be the first argument of a function. -> By convention,context.Contextshould be the first parameter of a function. This rule spots function declarations that do not follow the convention..imports. -> Importing with.makes the programs much harder to understand because it is unclear whether names belong to the current package or to an imported package. More information hereerrormust be named with the prefixerr.errors.New(fmt.Sprintf())withfmt.Errorf()-> It is possible to get a simpler program by replacingerrors.New(fmt.Sprintf())withfmt.Errorf(). This rule spots that kind of simplification opportunities.