chore(linters): Enable `unused-receiver` rule for revive (#16406)
This commit is contained in:
parent
09e3b59eb4
commit
7a92925f00
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 ""
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ type FakeSvcMgr struct {
|
|||
testData testData
|
||||
}
|
||||
|
||||
func (m *FakeSvcMgr) Disconnect() error {
|
||||
func (*FakeSvcMgr) Disconnect() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue