From 56b0be0b6af03b4414c8205cf9913a39cde42020 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 27 Jun 2026 16:38:07 +0200 Subject: [PATCH] fix(lint): use errors.Is for io.EOF comparison in sys_linux The errorlint linter rejects direct error comparison with != because it fails on wrapped errors. Compare via errors.Is(err, io.EOF) instead. --- internal/util/sys/sys_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/util/sys/sys_linux.go b/internal/util/sys/sys_linux.go index 554f9c983..4cca0fe57 100644 --- a/internal/util/sys/sys_linux.go +++ b/internal/util/sys/sys_linux.go @@ -4,6 +4,7 @@ package sys import ( "bufio" + "errors" "fmt" "io" "os" @@ -93,7 +94,7 @@ func CPUPercentRaw() (float64, error) { rd := bufio.NewReader(f) line, err := rd.ReadString('\n') - if err != nil && err != io.EOF { + if err != nil && !errors.Is(err, io.EOF) { return 0, err } // Expect: cpu user nice system idle iowait irq softirq steal guest guest_nice