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.
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?