-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
chore: Fix linter findings for unparam and revive.unused-parameter #12150
Conversation
@LarsStegman you introduced few days ago, in this PR #11786 in
Was that a mistake? Are you ok with removing it in this PR? |
@powersj You introduced in this PR #11672 in
In this PR I removed return values (it doesn't make sense to return always |
Yea you can remove it. It is a remainder from when the listener and read plug-in were still combined. I either loaded the listener client or read client which both implemented an interface, but that is not needed anymore now that they are split into separate plugins. Thanks! |
# Conflicts: # plugins/inputs/kafka_consumer/kafka_consumer_test.go
FYI going to need to deal with conflicts |
# Conflicts: # plugins/inputs/cloudwatch/cloudwatch_test.go # plugins/inputs/cloudwatch_metric_streams/cloudwatch_metric_streams_test.go # plugins/inputs/opcua/opcua_test.go # plugins/inputs/opcua_listener/opcua_listener_test.go
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
@powersj Deal done! |
@@ -100,11 +100,7 @@ func (p *Parser) Parse(input []byte) ([]telegraf.Metric, error) { | |||
} | |||
} | |||
|
|||
metric, err := p.handler.Metric() |
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.
@powersj I was trying to contrast this change with the Graphite Parser
and the socketlistener
(which uses the parsers).
The Graphite parser continues to return both errors and metrics. However, the socket_listener ignores the metrics if there are errors found.
Shouldn't the socket_listener try to accept the metrics that it received and also that the influx parser should send back the errors as well?
unparam
andrevive.unused-parameter
linters enabled.Fixes for following findings were made (for default configuration):
Moreover, I enabled locally
check-exported
flag forunparam
linter and fixed following findings:Unfortunatelly
unparam
linter is not able to check if function withresult ... is always nil
problem implements interface (so it must return something), thus following findings weren't fixed andcheck-exported
was not enabled globally: