Search⌘ K

Checking Test Coverage

Explore the importance of test coverage in Go programs and learn how to use the go test command with the -cover flag to measure and improve your test coverage. Understand how to identify uncovered code sections and enhance your tests to prevent deploying broken code.

We'll cover the following...

Checking the test coverage is super important because if your test coverage is incomplete, it is safe to assume that the uncovered parts are broken. You wouldn’t want to deploy broken code, so you better be aware of the test coverage and strive to 100%.

Checking test coverage

When writing tests for non-trivial code it’s important to make sure your tests actually cover the code. This is ...