Fix linter warning (#3280)

Fix S1009: should omit nil check; len() for nil maps is defined as zero (gosimple)

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2025-03-27 09:57:33 +01:00 committed by GitHub
parent 47e2bb34ce
commit 58ac08e216
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -446,7 +446,7 @@ func (c *ethtoolCollector) Update(ch chan<- prometheus.Metric) error {
} }
} }
if stats == nil || len(stats) < 1 { if len(stats) == 0 {
// No stats returned; device does not support ethtool stats. // No stats returned; device does not support ethtool stats.
continue continue
} }