]> Cypherpunks repositories - gostls13.git/commit
cmd/go: respect -coverpkg for unselected no-test packages
authorThan McIntosh <thanm@google.com>
Mon, 4 Mar 2024 15:52:56 +0000 (15:52 +0000)
committerThan McIntosh <thanm@google.com>
Mon, 4 Mar 2024 20:12:49 +0000 (20:12 +0000)
commit2b22fc10459dff0fb4b3e5b08bc14ffb349aa4dd
treeb5a5b1e13bcefe0142178d0be86d1aa2e9fc6a67
parentf1722e9a6e57e4e7b926c4204707f7a15091b5c0
cmd/go: respect -coverpkg for unselected no-test packages

This patch fixes a bug in the code that reports coverage percentages
and/or profiles for packages without tests. Specifically, the code
added as part of the fix for issue 24570 (in CL 495447) didn't
properly consider the -coverpkg selection and would look for the build
action meta-data file for a package that wasn't actually selected for
coverage.

Fixes #65653.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I66ffac11783c00a8cbd855fd05b9a90e4e0ed402
Reviewed-on: https://go-review.googlesource.com/c/go/+/568835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/cmd/go/internal/test/test.go
src/cmd/go/testdata/script/cover_coverpkg_partial.txt