cmd/go: cover tool help command syntax does not work on Windows #51126
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Windows
What did you do?
Running 'go tool cover -help' issues a help message that includes this command suggestion:
go tool cover -func=c.out
This works on the Mac and Linux, but not on Windows. On Windows it produces the following error message:
too many arguments For usage information, run "go tool cover -help"
The correct way to call this is:
go tool cover -func c.out
This works on all platforms.
Note that this bad usage pattern is sprinkled throughout the go ecosystem. For example, this web page: https://pkg.go.dev/cmd/cover, has this line:
Cover is a program for analyzing the coverage profiles generated by 'go test -coverprofile=cover.out'.
However, running that line in a windows cmd terminal produces:
no required module provides package .out; to add it: go get .out
Or here: https://pkg.go.dev/cmd/go#hdr-Build_constraints, it uses examples of
-buildmode=mode
, even though the documentation earlier specs it as-buildmode mode
.This clearly is a longstanding problem that should be easy to clean up.
The text was updated successfully, but these errors were encountered: