From 635bda9139474682263558656c146da1da2644a3 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 25 Aug 2026 09:43:56 +0000 Subject: [PATCH] hi: compare the stream error with errors.Is --- cmd/hi/stats.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/hi/stats.go b/cmd/hi/stats.go index f56043d96..fd333a824 100644 --- a/cmd/hi/stats.go +++ b/cmd/hi/stats.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + "io" "log" "slices" "strings" @@ -258,7 +259,7 @@ func (sc *StatsCollector) collectStatsForContainer(ctx context.Context, containe err := decoder.Decode(&stats) if err != nil { // [io.EOF] is expected when container stops or stream ends - if err.Error() != "EOF" && verbose { + if !errors.Is(err, io.EOF) && verbose { log.Printf("Failed to decode stats for container %s: %v", containerID[:12], err) }