Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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




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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: