News for hackers. Stuff that matters.
Re:Effective Go by jopsen on Sunday October 03, 2021 @03:05PM (#28739667)
> In Go you have to do this or your line/branch coverage will be abysmal.

If you're writing tests to improve coverage numbers then maybe you're motivation is wrong.

In most languages with automatic exception propagation you never know what exceptions can be thrown. Is it any different from not testing?

Re:Effective Go by closeparen on Sunday October 03, 2021 @03:13PM (#28739741)
It would be interesting to know what errors we might get, but unit testing an error return branch doesn't tell us that. It tells us that any non-nil error will be returned.