]> Cypherpunks repositories - gostls13.git/commit
cmd/go: don't generate output for "go build -o /dev/null x.go"
authorIan Lance Taylor <iant@golang.org>
Fri, 25 May 2018 21:27:29 +0000 (14:27 -0700)
committerIan Lance Taylor <iant@golang.org>
Sun, 27 May 2018 07:33:08 +0000 (07:33 +0000)
commitc1d9d1f305df19c66e28a619e17f9f1d7563d977
treeebcbbb4c9e7a97710513f10ad8e6fc47ee97de90
parent4258b43afe3d3c48010aeeae7c438e5a88c6b5ab
cmd/go: don't generate output for "go build -o /dev/null x.go"

We look for "-o /dev/null", and, if found, pretend that there was no
"-o" option and don't generate an action to create the final executable.

We look for "go build x.go", and, if found, and if -o was not used,
pretend that the user specified "-o x".

Unfortunately, we were doing those in the wrong order, so that "go
build -o /dev/null x.go" would first clear the "-o" option and then
set it to "-o x".

This CL flips the order so that the right thing happens.

Fixes #25579

Change-Id: Ic9556ac0a57f7b45b685951bc96ba5ea4633b860
Reviewed-on: https://go-review.googlesource.com/114715
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/go/go_test.go
src/cmd/go/internal/work/build.go