From 60a38db14c3a7e5da268e530917ba7a492c16d1e Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Wed, 26 Mar 2025 09:55:20 +0100 Subject: [PATCH] Fix linter warning Fix S1009: should omit nil check; len() for nil maps is defined as zero (gosimple) Signed-off-by: Ben Kochie --- collector/ethtool_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/ethtool_linux.go b/collector/ethtool_linux.go index 78f7afe2da..01410d6449 100644 --- a/collector/ethtool_linux.go +++ b/collector/ethtool_linux.go @@ -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. continue }