CodeQL / Analyze (actions) (push) Has been cancelled
Docker / build (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
GoReleaser Release / release (push) Has been cancelled
MCP Server Diff / mcp-diff (push) Has been cancelled
Publish to MCP Registry / publish (push) Has been cancelled
- Extract storeLine() and accumulate() helper closures to eliminate
duplicated line processing and truncation logic
- Simplify main loop by using early return pattern (newlineIdx < 0 -> break)
- Add test for empty response body edge case
- Add test for exact maxLineSize boundary condition (10MB)
The refactored code reduces nesting and makes the flow clearer:
accumulate handles byte collection with truncation detection,
storeLine handles ring buffer storage with truncation markers.