Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here is Code Coverage information for Secret Management Service

We are currently at 5470.4%8%

Here is a HTML browser for the code and coverage within:

coverage.html

The same coverage reported from the command line:

Image Removed

How to Generate Code Coverage Reports for Golang Applications

This document covers how to generate HTML Code Coverage Reports for Golang Applications.

Code Block
languagebash
titleGenerate and run a test executable which calls your main()
linenumberstrue
go test -c -covermode=count -coverpkg ./...
./sms.test -test.run "^TestMain$" -test.coverprofile=coverage.cov
Code Block
languagebash
titleRun your Unit tests for their coverage
linenumberstrue
go test -test.covermode=count -test.coverprofile=unit.out ./...
Code Block
languagebash
titleMerge coverage Reports
linenumberstrue
go get github.com/wadey/gocovmerge
gocovmerge unit.out coverage.cov > all.out

...

languagebash
titleGenerate Reports
linenumberstrue

...

Image Added