]> Cypherpunks repositories - gostls13.git/commitdiff
doc: add release note on coverage testing of no-test packages
authorThan McIntosh <thanm@google.com>
Tue, 5 Dec 2023 20:15:06 +0000 (15:15 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 6 Dec 2023 16:30:47 +0000 (16:30 +0000)
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 <bcmills@google.com>
Auto-Submit: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

doc/go1.22.html

index 05c7cc090c6758c7497bbc66204de0b99b5600ae..64afa898af9ee9af4ea57b010c93e1f3544cd928 100644 (file)
@@ -53,6 +53,25 @@ Do not send CLs removing the interior tags from such phrases.
   <!-- cmd/go: remove conversion of legacy pre-module dependency configs -->
 </p>
 
+<!-- CL 495447 -->
+<p>
+`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
+</p>
+
+<p>
+  <code>?     mymod/mypack    [no test files]</code>
+</p>
+
+<p>
+  and now with Go 1.22, functions in the package are treated as uncovered:
+</p>
+
+<p>
+  <code>mymod/mypack    coverage: 0.0% of statements</code>
+</p>
+
 <h3 id="cgo">Cgo</h3>
 
 <!-- https://go.dev/issue/56378 -->