Trim comments in the Workhorse body limit reader and tests
What does this MR do and why?
This is the comment pass requested in the maintainer review of !262085 (merged): it removes the comments that restate the code, following the comment discipline in the root AGENTS.md. !262085 (merged) merged before I pushed the pass, so it comes as its own merge request.
Only whole-line // comments change. The Go code is the same as on master.
bodylimit.go: the comment on thetooLargefield now says why the error is kept instead of what it holds. The probe has consumed a byte, so probing again could see EOF and report an oversized body as complete. The comment on the probe drops its first sentence, which restatedremaining <= 0, and now fits on one line.bodylimit_test.go: the two comments that restated the assertion under them (require.ErrorIswith the read error,require.Sameon later reads) are removed.routes_test.go: the comment on the echo backend is cut to one line.
I kept the two readSizes notes, because the field reads like a byte count but holds buffer lengths. I also kept the one on why TestIntegration hides the body length: that is what makes the request chunked.
No user-visible change, so no changelog entry.
References
Follow-up to !262085 (merged).
Screenshots or screen recordings
Not applicable: no UI change.
How to set up and validate locally
Not applicable: the change is comments only, so there is nothing to see running. Every line of the diff is a // comment.
What I ran (base aa3ea1f5)
- Every added or removed line of the diff is a whole-line
//comment. - A token comparison with
go/scanner, which skips comments, finds the Go tokens of the three files identical tomaster. The same comparison reports a difference for the code !262085 (merged) changed and forbodylimit.gowith one statement removed. - The new
tooLargecomment holds: without the kept error, the read afterRequestBodyTooLargeErrorreturnsEOFandTestCountingReadCloser_ReadsAgainAfterLimitfails. - On Go 1.26.9, the
workhorse:verifyjob's version:gofmtandgo vetof the two packages, their tests, the touched tests ten times with-race, andmake verify. - The commit message passes
scripts/lint/commit_linter.rbwithgitlab-dangerfiles4.13.0.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.