Correct way of calculating total coverage using coverpkg.

116 views
Skip to first unread message

Nicklas Wallgren

unread,
Nov 16, 2022, 10:19:15 AM11/16/22
to golang-nuts
I'm trying to calculate the total coverage for one of my repositories https://github.com/NicklasWallgren/go-template using
go test ./... -p 1 -coverprofile=build/coverage.out -coverpkg ./...

The coverage.out is successfully generated, but the report contains reoccurring rows and is quite large (several mb). 

The following line is duplicated 3x.
github.com/NicklasWallgren/go-template/adapters/driven/health/health_checker_manager.go:18.92,20.2 1 1

Without -coverpkg the report is only 7.5 K, and doesn't contain any duplicated rows. Is this the expected result, or am I doing something wrong?

Reply all
Reply to author
Forward
0 new messages