Skip to content

Commit 51885c1

Browse files
committed
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 golang#60785. Change-Id: I67dbc96ad9fc5c6f43d5c1e4e903e4b8589b154f Reviewed-on: https://go-review.googlesource.com/c/go/+/503735 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Than McIntosh <[email protected]>
1 parent 3479e1e commit 51885c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cmd/cover/cover.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const (
9595
func main() {
9696
objabi.AddVersionFlag()
9797
flag.Usage = usage
98-
flag.Parse()
98+
objabi.Flagparse(usage)
9999

100100
// Usage information when no arguments.
101101
if flag.NFlag() == 0 && flag.NArg() == 0 {

src/cmd/go/internal/work/exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3886,7 +3886,7 @@ func useResponseFile(path string, argLen int) bool {
38863886
// TODO: Note that other toolchains like CC are missing here for now.
38873887
prog := strings.TrimSuffix(filepath.Base(path), ".exe")
38883888
switch prog {
3889-
case "compile", "link", "cgo", "asm":
3889+
case "compile", "link", "cgo", "asm", "cover":
38903890
default:
38913891
return false
38923892
}

0 commit comments

Comments
 (0)