From: Than McIntosh Date: Mon, 5 Feb 2024 16:58:35 +0000 (-0500) Subject: dog/go1.22: tweak coverage testing notes X-Git-Tag: go1.23rc1~1297 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4b0e086348c99eaa458f18e4b3e4498f0aaadc1a;p=gostls13.git dog/go1.22: tweak coverage testing notes Clarify the section in the "go" command notes that deals with the changes to "go test -cover" for packages without tests, adding a note that if a package has not tests and no executable code, you still get a "package has no test files" diagnostic. Fixes #65262. Change-Id: Ie960871f9d5c1a1965090738644eace28fc3e156 Reviewed-on: https://go-review.googlesource.com/c/go/+/561337 Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Chris Hines --- diff --git a/doc/go1.22.html b/doc/go1.22.html index 39e2dca610..f9750a3191 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -101,9 +101,10 @@ func main() {

-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 + 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

@@ -118,6 +119,13 @@ packages that do not have their own test files. Prior to Go 1.22 a mymod/mypack coverage: 0.0% of statements

+

+ Note that if a package contains no executable code at all, we can't report + a meaningful coverage percentage; for such packages the go tool + will continue to report that there are no test files. +

+ +

Trace