aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2024-02-05 11:58:35 -0500
committerThan McIntosh <thanm@google.com>2024-02-06 15:59:53 +0000
commit4b0e086348c99eaa458f18e4b3e4498f0aaadc1a (patch)
treec565a207068c3a326f8bea4667bc2e51b5854fd0 /doc
parent6f44cc88f5f94253096ceed16b8e0fdb117cdd06 (diff)
downloadgo-4b0e086348c99eaa458f18e4b3e4498f0aaadc1a.tar.gz
go-4b0e086348c99eaa458f18e4b3e4498f0aaadc1a.zip
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 <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Chris Hines <chris.cs.guy@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/go1.22.html14
1 files changed, 11 insertions, 3 deletions
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() {
<!-- CL 495447 -->
<p>
-<code>go</code> <code>test</code> <code>-cover</code> now prints coverage summaries for covered
-packages that do not have their own test files. Prior to Go 1.22 a
-<code>go</code> <code>test</code> <code>-cover</code> run for such a package would report
+ <code>go</code> <code>test</code> <code>-cover</code> now prints coverage summaries
+ for covered packages that do not have their own test files. Prior to Go 1.22 a
+ <code>go</code> <code>test</code> <code>-cover</code> run for such a package would
+ report
</p>
<p>
@@ -118,6 +119,13 @@ packages that do not have their own test files. Prior to Go 1.22 a
<code>mymod/mypack coverage: 0.0% of statements</code>
</p>
+<p>
+ Note that if a package contains no executable code at all, we can't report
+ a meaningful coverage percentage; for such packages the <code>go</code> tool
+ will continue to report that there are no test files.
+</p>
+
+
<h3 id="trace">Trace</h3>
<!-- https://go.dev/issue/63960 -->