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.
This commit is contained in:
sam committed 2026-08-24 13:28:51 +10:00
1 parent 0cb8374269
commit c460a80c11
1 file changed
+2 -5
+2 -5
View File
@@ -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