diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 16a4ebaa0f..cacb4c05df 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -2042,6 +2042,9 @@ func (b *Builder) runOut(a *Action, dir string, env []string, cmdargs ...interfa var buf bytes.Buffer cmd := exec.Command(cmdline[0], cmdline[1:]...) + if cmd.Path != "" { + cmd.Args[0] = cmd.Path + } cmd.Stdout = &buf cmd.Stderr = &buf cleanup := passLongArgsInResponseFiles(cmd)