Skip to content

Commit

Permalink
Fix lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpeshansky committed Sep 11, 2024
1 parent dd39c32 commit 5de8b1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ linters-settings:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
disable:
- fieldalignment
- shadow
enable-all: true
misspell:
locale: US
6 changes: 3 additions & 3 deletions receiver/dcgmreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ func (client *dcgmClient) collect() (time.Duration, error) {
func (client *dcgmClient) getDeviceMetrics() map[uint]deviceMetrics {
out := map[uint]deviceMetrics{}
for gpuIndex, device := range client.devices {
new := MetricsMap{}
newMetrics := MetricsMap{}
for key, value := range device.Metrics {
newValue := *value
new[key] = &newValue
newMetrics[key] = &newValue
}
// device is already a copy here
device.Metrics = new
device.Metrics = newMetrics
out[gpuIndex] = device
}
return out
Expand Down
3 changes: 1 addition & 2 deletions receiver/dcgmreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (s *dcgmScraper) start(ctx context.Context, _ component.Host) error {

s.cancel = func() {
scrapeCancel()
g.Wait()
_ = g.Wait() // Ignore the error from a canceled context
}

metricsCh := make(chan map[uint]deviceMetrics)
Expand Down Expand Up @@ -196,7 +196,6 @@ func (s *dcgmScraper) runConnectLoop(ctx context.Context, metricsCh chan<- map[u
case <-time.After(s.initRetryDelay):
}
}
return nil
}

func (s *dcgmScraper) pollClient(ctx context.Context, client *dcgmClient, metricsCh chan<- map[uint]deviceMetrics, collectTriggerCh <-chan struct{}) {
Expand Down

0 comments on commit 5de8b1c

Please sign in to comment.