Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
enrichman opened this issue May 25, 2023 · 5 comments
Closed

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

enrichman opened this issue May 25, 2023 · 5 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@enrichman
Copy link
Contributor

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.

@seankhliao seankhliao changed the title cmd/go: cmd/go: -cover flag documentation out of date May 25, 2023
@enrichman enrichman changed the title cmd/go: -cover flag documentation out of date cmd/go: missing -covermod flag help message and wrong -cover help message May 25, 2023
@enrichman enrichman changed the title cmd/go: missing -covermod flag help message and wrong -cover help message cmd/go: -cover flag documentation out of date May 25, 2023
@enrichman
Copy link
Contributor Author

Thanks @seankhliao for the title, I hit return too early. 😄

@seankhliao
Copy link
Member

feel free to submit a PR/CL
if you run go test with the version you edited, it should output instructions on keeping everything up to date

@ianlancetaylor
Copy link
Contributor

CC @thanm

@enrichman
Copy link
Contributor Author

enrichman commented May 25, 2023

I'm not sure if this could be the chance to drop the goexperiment.CoverageRedesign flag.
Maybe in a separate PR, keeping this one only for the doc?

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/498415 mentions this issue: cmd/go: update cover flag documentation

@dmitshur dmitshur added this to the Go1.21 milestone May 26, 2023
@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label May 26, 2023
@golang golang locked and limited conversation to collaborators May 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants