cmd/{go,cover}: enable response file args for cmd/cover

Change the cover command to accept arguments via response files, using
the same mechanism employed for the compiler and the assembler. This
is needed now that the cover tool accepts a list of all source files
in a package, as opposed to just a single source file, and as a result
can run into system-dependent command line length limits.

Fixes #60785.

Change-Id: I67dbc96ad9fc5c6f43d5c1e4e903e4b8589b154f
Reviewed-on: https://go-review.googlesource.com/c/go/+/503735
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
changes/35/503735/3
Than McIntosh 2023-06-15 09:14:03 -04:00
parent 3479e1e543
commit 51885c1fa2
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ const (
func main() {
objabi.AddVersionFlag()
flag.Usage = usage
flag.Parse()
objabi.Flagparse(usage)
// Usage information when no arguments.
if flag.NFlag() == 0 && flag.NArg() == 0 {

View File

@ -3886,7 +3886,7 @@ func useResponseFile(path string, argLen int) bool {
// TODO: Note that other toolchains like CC are missing here for now.
prog := strings.TrimSuffix(filepath.Base(path), ".exe")
switch prog {
case "compile", "link", "cgo", "asm":
case "compile", "link", "cgo", "asm", "cover":
default:
return false
}