-
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 revive:unused-receiver
in plugins/outputs
#16338
base: master
Are you sure you want to change the base?
chore: Fix linter findings for revive:unused-receiver
in plugins/outputs
#16338
Conversation
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
@zak-pawel thanks for the PR! Two questions...
@@ -424,7 +424,7 @@ func (a *Elasticsearch) createNewTemplate(templatePattern string) (*bytes.Buffer | |||
return &tmpl, nil | |||
} | |||
|
|||
func (a *Elasticsearch) GetTagKeys(indexName string) (string, []string) { | |||
func GetTagKeys(indexName string) (string, []string) { |
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.
Do we need to export this function?
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.
@srebhan Yes, you’re right, they can be unexported. Do you mind if I take care of this as part of fixing linter findings for revive:exported
effort?
@@ -60,7 +60,7 @@ func (*Zabbix) SampleConfig() string { | |||
// Connect does nothing, Write() would initiate connection in each call. | |||
// Checking if Zabbix server is alive in this step does not allow Telegraf | |||
// to start if there is a temporal connection problem with the server. | |||
func (z *Zabbix) Connect() error { | |||
func (*Zabbix) Connect() 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.
Given that both Connect
and Close
are empty, we can remove both, can't we?
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.
@srebhan Then this plugin would stop being an output plugin:
Summary
Address findings for revive:unused-receiver in
plugins/outputs
.It is only part of the bigger work for #16190.
After all findings of this type in whole project are handled, we can enable
revive:unused-receiver
rule ingolangci-lint
.Checklist