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 Darwin #12958

Merged
merged 1 commit into from
Mar 28, 2023
Merged

chore: Fix linter findings for Darwin #12958

merged 1 commit into from
Mar 28, 2023

Conversation

zak-pawel
Copy link
Collaborator

golangci-lint checks in Telegraf repo are by default run only for linux.
This PR addresses findings discovered after running following command:

GOOS=darwin make lint-branch

Following findings were fixed:

config/secret_without_mlock.go:9:14                     revive     unused-parameter: parameter 'secret' seems to be unused, consider removing or renaming it as _
plugins/inputs/cgroup/cgroup_notlinux.go:9:25           revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/inputs/diskio/diskio_other.go:7:27              revive     unused-parameter: parameter 'devName' seems to be unused, consider removing or renaming it as _
plugins/inputs/diskio/diskio_other.go:15:20             revive     unused-parameter: parameter 'name' seems to be unused, consider removing or renaming it as _
plugins/inputs/dmcache/dmcache_notlinux.go:9:26         revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/inputs/ethtool/ethtool.go:14:5                  unused     var `downInterfacesBehaviors` is unused
plugins/inputs/ethtool/ethtool_notlinux.go:15:26        revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/inputs/infiniband/infiniband_notlinux.go:15:1   revive     receiver-naming: receiver name should not be an underscore, omit the name if it is unused
plugins/inputs/infiniband/infiniband_notlinux.go:15:29  revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/inputs/intel_powerstat/dto.go:4:2               unused     field `mperf` is unused
plugins/inputs/intel_powerstat/dto.go:5:2               unused     field `aperf` is unused
plugins/inputs/intel_powerstat/dto.go:6:2               unused     field `timeStampCounter` is unused
plugins/inputs/intel_powerstat/dto.go:7:2               unused     field `c3` is unused
plugins/inputs/intel_powerstat/dto.go:8:2               unused     field `c6` is unused
plugins/inputs/intel_powerstat/dto.go:9:2               unused     field `c7` is unused
plugins/inputs/intel_powerstat/dto.go:10:2              unused     field `throttleTemp` is unused
plugins/inputs/intel_powerstat/dto.go:11:2              unused     field `temp` is unused
plugins/inputs/intel_powerstat/dto.go:12:2              unused     field `mperfDelta` is unused
plugins/inputs/intel_powerstat/dto.go:13:2              unused     field `aperfDelta` is unused
plugins/inputs/intel_powerstat/dto.go:14:2              unused     field `timeStampCounterDelta` is unused
plugins/inputs/intel_powerstat/dto.go:15:2              unused     field `c3Delta` is unused
plugins/inputs/intel_powerstat/dto.go:16:2              unused     field `c6Delta` is unused
plugins/inputs/intel_powerstat/dto.go:17:2              unused     field `c7Delta` is unused
plugins/inputs/intel_powerstat/dto.go:18:2              unused     field `readDate` is unused
plugins/inputs/intel_powerstat/dto.go:22:2              unused     field `dramCurrentEnergy` is unused
plugins/inputs/intel_powerstat/dto.go:23:2              unused     field `socketCurrentEnergy` is unused
plugins/inputs/intel_powerstat/dto.go:24:2              unused     field `socketEnergy` is unused
plugins/inputs/intel_powerstat/dto.go:25:2              unused     field `dramEnergy` is unused
plugins/inputs/intel_powerstat/dto.go:26:2              unused     field `readDate` is unused
plugins/inputs/intel_powerstat/dto.go:30:2              unused     field `physicalID` is unused
plugins/inputs/intel_powerstat/dto.go:31:2              unused     field `coreID` is unused
plugins/inputs/intel_powerstat/dto.go:32:2              unused     field `cpuID` is unused
plugins/inputs/intel_powerstat/dto.go:33:2              unused     field `vendorID` is unused
plugins/inputs/intel_powerstat/dto.go:34:2              unused     field `cpuFamily` is unused
plugins/inputs/intel_powerstat/dto.go:35:2              unused     field `model` is unused
plugins/inputs/intel_powerstat/dto.go:36:2              unused     field `flags` is unused
plugins/inputs/kernel/kernel_notlinux.go:25:23          revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/inputs/powerdns/powerdns_test.go:10:6           unused     type `statServer` is unused
plugins/inputs/powerdns/powerdns_test.go:47:21          unused     func `statServer.serverSocket` is unused
plugins/inputs/synproxy/synproxy_notlinux.go:15:27      revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/inputs/wireless/wireless_notlinux.go:15:27      revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/inputs/zfs/zfs_other.go:10:22                   revive     unused-parameter: parameter 'acc' seems to be unused, consider removing or renaming it as _
plugins/secretstores/os/os_darwin.go:16:70              errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors

Following findings were ignored (mentioned fields/types are unused for darwin but are used for linux):

plugins/inputs/diskio/diskio.go:33:2       unused  field `infoCache` is unused
plugins/inputs/diskio/diskio_other.go:5:6  unused  type `diskInfoCache` is unused
plugins/inputs/ethtool/ethtool.go:43:2     unused  field `interfaceFilter` is unused
plugins/inputs/ethtool/ethtool.go:44:2     unused  field `namespaceFilter` is unused
plugins/inputs/ethtool/ethtool.go:45:2     unused  field `includeNamespaces` is unused
plugins/inputs/ethtool/ethtool.go:48:2     unused  field `command` is unused

@telegraf-tiger telegraf-tiger bot added the chore label Mar 26, 2023
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning these up

@powersj powersj 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 Mar 27, 2023
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.

Thanks @zak-pawel!

@srebhan srebhan merged commit 73076bb into influxdata:master Mar 28, 2023
srebhan pushed a commit that referenced this pull request Apr 3, 2023
Co-authored-by: Pawel Zak <Pawel Zak>
(cherry picked from commit 73076bb)
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