From ef75feb9b4734f95a4a043d6faece0632303dba8 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 24 Aug 2026 13:28:51 +1000 Subject: [PATCH] chore(gateway): apply go fix rewrites in stream.go Pre-existing code `task fmt` rewrites on every run: a manual clamp to `max`, and a `strings.Split` range to `strings.SplitSeq`. Both are semantically identical; committing them keeps the gate from reporting a dirty tree on unrelated work. --- internal/gateway/stream.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/gateway/stream.go b/internal/gateway/stream.go index 6278f24df..b0579bb4d 100644 --- a/internal/gateway/stream.go +++ b/internal/gateway/stream.go @@ -97,10 +97,7 @@ func toolPreview(name, output string) string { } return "completed with no printable preview" } - remaining := countNonEmptyOrContentLines(content) - 1 - skipped - if remaining < 0 { - remaining = 0 - } + remaining := max(countNonEmptyOrContentLines(content)-1-skipped, 0) if remaining > 0 { return fmt.Sprintf("%s\n… %d more lines", preview, remaining) } @@ -110,7 +107,7 @@ func toolPreview(name, output string) string { func compactToolPreview(output string) (string, int) { skipped := 0 - for _, line := range strings.Split(output, "\n") { + for line := range strings.SplitSeq(output, "\n") { line = strings.TrimSpace(line) if line == "" { continue