Typo in: TestRemoveNewLineSuffix_EndingWithoutNewline (page 272, incosistent with page 273)
Author: NelfanderCreated Mar 29, 2026Updated Jul 8, 2026
Labelserratum
Hello,
I noticed a likely typo in Chapter 11 (Testing), page 272.
The test: TestRemoveNewLineSuffix_EndingWithoutNewline
uses: got := removeNewLineSuffixes("a\n")
However, this duplicates the “EndingWithNewLine” (page 271) case and does not test the “without newline” scenario.
On page 273, the table-driven version correctly uses: input: "a"
So I believe the page 272 test should also use "a" instead of "a\n".
Thanks for the great book!
Source: teivah/100-go-mistakes