Skip to content

cmd/go: -cover flag documentation out of date #60438

@enrichman

Description

@enrichman

While playing with the new -cover flag I was trying to see how to switch to the covermod=count.

Running the go help build I've seen no available flag for it, but still the -covermod flag is available and working fine.

I've seen also that the -cover flag is showing a probably old message (the GOEXPERIMENT env var is not required).

-cover
	enable code coverage instrumentation (requires
	that GOEXPERIMENT=coverageredesign be set).

I'm willing to help about this if is confirmed as an issue, or just a doc misalignment.

The docs says that it's generated with a mkalldocs.sh script, but I haven't found it.

What version of Go are you using (go version)?

$ go version
go version go1.20.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/enrico/Development/go/bin"
GOCACHE="/Users/enrico/Library/Caches/go-build"
GOENV="/Users/enrico/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/enrico/Development/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/enrico/Development/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dg/xjrxmyds5p7_7xm9r12m79xw0000gn/T/go-build3135499840=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Run a go help build.

What did you expect to see?

The "right" -cover flag message, and the missing -covermod flag message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions