Golang coverage

From wikinotes
Revision as of 04:09, 18 July 2022 by Will (talk | contribs) (Created page with "Go ships with a test coverage measuring tool. = Usage = <blockquote> <syntaxhighlight lang="bash"> go test -coverprofile=out.cov ./... # report coverage to 'out.cov' go tool cover -html=out.cov # open report in web </syntaxhighlight> </blockquote><!-- Usage -->")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Go ships with a test coverage measuring tool.

Usage

go test -coverprofile=out.cov ./...  # report coverage to 'out.cov'
go tool cover -html=out.cov          # open report in web