Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zak-pawel
Copy link
Collaborator

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 in golangci-lint.

Checklist

  • No AI generated code was used in this PR

@DStrand1 DStrand1 removed their assignment Jan 13, 2025
@DStrand1 DStrand1 added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jan 13, 2025
Copy link
Member

@srebhan srebhan left a 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) {
Copy link
Member

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?

Copy link
Collaborator Author

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 {
Copy link
Member

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?

Copy link
Collaborator Author

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:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore linter ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants