From 51885c1fa2eff36c421d6669816f971b54b63a33 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Thu, 15 Jun 2023 09:14:03 -0400 Subject: [PATCH] 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 Reviewed-by: Ian Lance Taylor Run-TryBot: Than McIntosh --- src/cmd/cover/cover.go | 2 +- src/cmd/go/internal/work/exec.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/cover/cover.go b/src/cmd/cover/cover.go index ea6562c999..a4b837c9ad 100644 --- a/src/cmd/cover/cover.go +++ b/src/cmd/cover/cover.go @@ -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 { diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index eb05c91f30..d38a051b2b 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -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 } -- 2.50.0