Doing frequent and comprehensive unit testing of your code is best practice. Having repeatable (and automated) tests to use for regression test after changes is also best practice. Often, these practices are combined. Similarly, running frequent benchmarks of the performance of your code is best practice. Often, one should create a test suite that achieves as close to 100% code coverage as practical.1 While not covered deeply in this text, the Go standard runtime supports code coverage tests. ...
10. Go Unit Tests and Benchmarks
Get Go for Java Programmers: Learn the Google Go Programming Language now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.