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 the tooLarge field 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 restated remaining <= 0, and now fits on one line.
  • bodylimit_test.go: the two comments that restated the assertion under them (require.ErrorIs with the read error, require.Same on 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 to master. The same comparison reports a difference for the code !262085 (merged) changed and for bodylimit.go with one statement removed.
  • The new tooLarge comment holds: without the kept error, the read after RequestBodyTooLargeError returns EOF and TestCountingReadCloser_ReadsAgainAfterLimit fails.
  • On Go 1.26.9, the workhorse:verify job's version: gofmt and go vet of the two packages, their tests, the touched tests ten times with -race, and make verify.
  • The commit message passes scripts/lint/commit_linter.rb with gitlab-dangerfiles 4.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.

Merge request reports

Loading
Loading