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

If you want to make testing a bit less verbose, you can look into testify (https://github.com/stretchr/testify), it adds some helpful assertions (no more 'if err != nil ...').

If you are using interfaces with dependency injection, it is easy to mock the dependencies of whatever you are unit testing implementing the interfaces you have defined in your testing file.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: