Using third-party testing frameworks

One great thing about testing Go code is that the language itself comes with batteries included: it ships with a built-in, albeit minimalistic, framework for authoring and running tests.

From a purist's perspective, that's all that you need to be up and running! The built-in testing package provides all the required mechanisms for running, skipping, or failing tests. All the software engineer needs to do is set up the required test dependencies and write the appropriate predicates for each test. One caveat of using the testing package is that it does not provide any of the more sophisticated test primitives, such as assertions or mocks, that you may be used to if you've come from a Java, Ruby, or Python ...

Get Hands-On Software Engineering with Golang 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.