From dbbc09b09cd7c467bd5d3e5d492fb1ed71e5e148 Mon Sep 17 00:00:00 2001 From: Virgil Date: Wed, 1 Apr 2026 20:39:25 +0000 Subject: [PATCH] refactor(agentic): remove io import from fleet event reader Co-Authored-By: Virgil --- pkg/agentic/platform.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/agentic/platform.go b/pkg/agentic/platform.go index 2674163..723568f 100644 --- a/pkg/agentic/platform.go +++ b/pkg/agentic/platform.go @@ -5,7 +5,6 @@ package agentic import ( "bufio" "context" - "io" "net/http" "time" @@ -811,7 +810,7 @@ func (s *PrepSubsystem) eventPayloadValue(body string) map[string]any { } } -func readFleetEventBody(body io.ReadCloser) (string, error) { +func readFleetEventBody(body interface{ Read([]byte) (int, error) }) (string, error) { reader := bufio.NewReader(body) rawLines := make([]string, 0, 4) dataLines := make([]string, 0, 4) @@ -830,7 +829,7 @@ func readFleetEventBody(body io.ReadCloser) (string, error) { } } - if err == io.EOF { + if err != nil && err.Error() == "EOF" { if len(dataLines) > 0 { return core.Join("\n", dataLines...), nil }