Skip to content

Commit

Permalink
Remove nil pointer dereference in test (kuskoman#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuskoman authored Mar 4, 2024
1 parent de1724f commit d714378
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/collectors/nodeinfo/nodeinfo_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestCollectNotNil(t *testing.T) {
var foundMetrics []string
for metric := range ch {
if metric == nil {
t.Errorf("expected metric %s not to be nil", metric.Desc().String())
t.Error("expected metric not to be nil")
}

foundMetricDesc := metric.Desc().String()
Expand Down
2 changes: 1 addition & 1 deletion internal/collectors/nodestats/nodestats_collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestCollectNotNil(t *testing.T) {
var foundMetrics []string
for metric := range ch {
if metric == nil {
t.Errorf("expected metric %s not to be nil", metric.Desc().String())
t.Error("expected metric not to be nil")
}

foundMetricDesc := metric.Desc().String()
Expand Down

0 comments on commit d714378

Please sign in to comment.