Skip to content

Commit 58ac08e

Browse files
authored
Fix linter warning (#3280)
Fix S1009: should omit nil check; len() for nil maps is defined as zero (gosimple) Signed-off-by: Ben Kochie <[email protected]>
1 parent 47e2bb3 commit 58ac08e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collector/ethtool_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ func (c *ethtoolCollector) Update(ch chan<- prometheus.Metric) error {
446446
}
447447
}
448448

449-
if stats == nil || len(stats) < 1 {
449+
if len(stats) == 0 {
450450
// No stats returned; device does not support ethtool stats.
451451
continue
452452
}

0 commit comments

Comments
 (0)