Skip to content

Commit

Permalink
cmd/go: update cover flag documentation
Browse files Browse the repository at this point in the history
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 <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Than McIntosh <[email protected]>
Run-TryBot: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
  • Loading branch information
enrichman authored and gopherbot committed May 27, 2023
1 parent ccc42b0 commit 7ad92e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/cmd/go/alldocs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions src/cmd/go/internal/work/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7ad92e9

Please sign in to comment.