From c002a5d8abef3037dd5f13e0c60cf42b86b4d885 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Tue, 5 Dec 2023 15:15:06 -0500 Subject: [PATCH] doc: add release note on coverage testing of no-test packages Add a small release note blurb to describe the changes in CL 495447 relating to "go test -cover" runs on packages with functions but no tests. For #61422. Change-Id: Ib8163ac70b902f0d7f9f470b944e7f70711e3cf3 Reviewed-on: https://go-review.googlesource.com/c/go/+/547635 Reviewed-by: Bryan Mills Auto-Submit: Than McIntosh LUCI-TryBot-Result: Go LUCI --- doc/go1.22.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/go1.22.html b/doc/go1.22.html index 05c7cc090c..64afa898af 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -53,6 +53,25 @@ Do not send CLs removing the interior tags from such phrases.

+ +

+`go` `test` `-cover` now prints coverage summaries for covered +packages that do not have their own test files. Prior to Go 1.22 a +`go` `test` `-cover` run for such a package would report +

+ +

+ ? mymod/mypack [no test files] +

+ +

+ and now with Go 1.22, functions in the package are treated as uncovered: +

+ +

+ mymod/mypack coverage: 0.0% of statements +

+

Cgo

-- 2.50.0