From 58ac08e2160a3e0e9d5893722f2bf2c41b842403 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Thu, 27 Mar 2025 09:57:33 +0100 Subject: [PATCH] Fix linter warning (#3280) 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 78f7afe2..01410d64 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 }