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(linters): Enable unused-receiver rule for revive #16406

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ linters-settings:
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
- name: unused-receiver
- name: var-declaration
- name: var-naming
- name: waitgroup-by-value
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/processes/processes_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (e *Processes) Init() error {
return nil
}

func (e *Processes) Gather(_ telegraf.Accumulator) error {
func (*Processes) Gather(telegraf.Accumulator) error {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/temp/temp_notlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (t *Temperature) Init() error {
return nil
}

func (t *Temperature) Gather(acc telegraf.Accumulator) error {
func (*Temperature) Gather(acc telegraf.Accumulator) error {
temps, err := sensors.SensorsTemperatures()
if err != nil {
var sensorsWarnings *sensors.Warnings
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/win_eventlog/win_eventlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (w *WinEventLog) Stop() {
}

func (w *WinEventLog) GetState() interface{} {
bookmarkXML, err := w.renderBookmark(w.bookmark)
bookmarkXML, err := renderBookmark(w.bookmark)
srebhan marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
w.Log.Errorf("State-persistence failed, cannot render bookmark: %v", err)
return ""
Expand Down Expand Up @@ -381,7 +381,7 @@ func (w *WinEventLog) fetchEvents(subsHandle EvtHandle) ([]Event, error) {
return events, evterr
}

func (w *WinEventLog) renderBookmark(bookmark EvtHandle) (string, error) {
func renderBookmark(bookmark EvtHandle) (string, error) {
var bufferUsed, propertyCount uint32

buf := make([]byte, bufferSize)
Expand Down
6 changes: 3 additions & 3 deletions plugins/inputs/win_perf_counters/performance_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type performanceQueryImpl struct {

type performanceQueryCreatorImpl struct{}

func (m performanceQueryCreatorImpl) NewPerformanceQuery(_ string, maxBufferSize uint32) PerformanceQuery {
func (performanceQueryCreatorImpl) NewPerformanceQuery(_ string, maxBufferSize uint32) PerformanceQuery {
return &performanceQueryImpl{maxBufferSize: maxBufferSize}
}

Expand Down Expand Up @@ -181,7 +181,7 @@ func (m *performanceQueryImpl) ExpandWildCardPath(counterPath string) ([]string,
}

// GetFormattedCounterValueDouble computes a displayable value for the specified counter
func (m *performanceQueryImpl) GetFormattedCounterValueDouble(hCounter pdhCounterHandle) (float64, error) {
func (*performanceQueryImpl) GetFormattedCounterValueDouble(hCounter pdhCounterHandle) (float64, error) {
var counterType uint32
var value pdhFmtCountervalueDouble

Expand Down Expand Up @@ -287,7 +287,7 @@ func (m *performanceQueryImpl) CollectDataWithTime() (time.Time, error) {
return mtime, nil
}

func (m *performanceQueryImpl) IsVistaOrNewer() bool {
func (*performanceQueryImpl) IsVistaOrNewer() bool {
return PdhAddEnglishCounterSupported()
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/win_perf_counters/win_perf_counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func extractCounterInfoFromCounterPath(counterPath string) (computer string, obj
return computer, object, instance, counter, nil
}

func (m *WinPerfCounters) SampleConfig() string {
func (*WinPerfCounters) SampleConfig() string {
return sampleConfig
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/win_services/win_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (m *winSvcMgr) ListServices() ([]string, error) {
type mgProvider struct {
}

func (rmr *mgProvider) Connect() (WinServiceManager, error) {
func (*mgProvider) Connect() (WinServiceManager, error) {
srebhan marked this conversation as resolved.
Show resolved Hide resolved
h, err := windows.OpenSCManager(nil, nil, windows.GENERIC_READ)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/win_services/win_services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type FakeSvcMgr struct {
testData testData
}

func (m *FakeSvcMgr) Disconnect() error {
func (*FakeSvcMgr) Disconnect() error {
srebhan marked this conversation as resolved.
Show resolved Hide resolved
return nil
}

Expand Down Expand Up @@ -77,7 +77,7 @@ type FakeWinSvc struct {
testData serviceTestInfo
}

func (m *FakeWinSvc) Close() error {
func (*FakeWinSvc) Close() error {
return nil
}
func (m *FakeWinSvc) Config() (mgr.Config, error) {
Expand Down
Loading