]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: update cover flag documentation
authorEnrico Candino <enrico.candino@gmail.com>
Thu, 25 May 2023 22:52:57 +0000 (00:52 +0200)
committerGopher Robot <gobot@golang.org>
Sat, 27 May 2023 02:24:47 +0000 (02:24 +0000)
Cover flag documentation was not up to date, and the -covermode flag
documentation was missing.

Fixes #60438

Change-Id: I11e769fa2a32d074de7a748aa534afdfe2ca4e78
Reviewed-on: https://go-review.googlesource.com/c/go/+/498415
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/work/build.go

index 46466fd5c858594fd1a1bbe8f783ae3fed05d093..4124eef78adeb724cd709f2e563b401531f04676 100644 (file)
 //             Supported only on linux/amd64 or linux/arm64 and only with GCC 7 and higher
 //             or Clang/LLVM 9 and higher.
 //     -cover
-//             enable code coverage instrumentation (requires
-//             that GOEXPERIMENT=coverageredesign be set).
+//             enable code coverage instrumentation.
+//     -covermode set,count,atomic
+//             set the mode for coverage analysis.
+//             The default is "set" unless -race is enabled,
+//             in which case it is "atomic".
+//             The values:
+//             set: bool: does this statement run?
+//             count: int: how many times does this statement run?
+//             atomic: int: count, but correct in multithreaded tests;
+//                     significantly more expensive.
+//             Sets -cover.
 //     -coverpkg pattern1,pattern2,pattern3
 //             For a build that targets package 'main' (e.g. building a Go
 //             executable), apply coverage analysis to each package matching
 //             do not delete it when exiting.
 //     -x
 //             print the commands.
-//
 //     -asmflags '[pattern=]arg list'
 //             arguments to pass on each go tool asm invocation.
 //     -buildmode mode
index 1e6f5c9d76cafb019cf69ae67f0aa431f1b38e74..552cc2a6d4765ecac2929b53f3c76445be650037 100644 (file)
@@ -84,8 +84,17 @@ and test commands:
                Supported only on linux/amd64 or linux/arm64 and only with GCC 7 and higher
                or Clang/LLVM 9 and higher.
        -cover
-               enable code coverage instrumentation (requires
-               that GOEXPERIMENT=coverageredesign be set).
+               enable code coverage instrumentation.
+       -covermode set,count,atomic
+               set the mode for coverage analysis.
+               The default is "set" unless -race is enabled,
+               in which case it is "atomic".
+               The values:
+               set: bool: does this statement run?
+               count: int: how many times does this statement run?
+               atomic: int: count, but correct in multithreaded tests;
+                       significantly more expensive.
+               Sets -cover.
        -coverpkg pattern1,pattern2,pattern3
                For a build that targets package 'main' (e.g. building a Go
                executable), apply coverage analysis to each package matching
@@ -99,7 +108,6 @@ and test commands:
                do not delete it when exiting.
        -x
                print the commands.
-
        -asmflags '[pattern=]arg list'
                arguments to pass on each go tool asm invocation.
        -buildmode mode