Skip to content

Coverage

Run the unit tests with coverage and print a per-function summary:

go test -covermode=atomic -coverpkg=./... -coverprofile=integrationcover.log $(go list ./... | grep -v '/cmd/')
go tool cover -func=integrationcover.log

The first command writes the profile to integrationcover.log.

To view coverage as an HTML report:

go tool cover -html=integrationcover.log -o coverage.html