Skip to content

Commit

Permalink
chore(linters): Enable unused-receiver rule for revive
Browse files Browse the repository at this point in the history
  • Loading branch information
zak-pawel committed Jan 15, 2025
1 parent 4e7821a commit 00848a9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
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)
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) {
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 {
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

0 comments on commit 00848a9

Please sign in to comment.