-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: allow -o to point to a folder that writes multiple execs
If -o points to a directory that exists then allow multiple executables to be written to that directory. Fixes #14295 Change-Id: Ic951e637c70a2ada5e7534bae9a43901a39fe2c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/167679 Run-TryBot: Daniel Theophanes <kardianos@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
- Loading branch information
Showing
3 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Verify build -o can output multiple executables to a directory. | ||
|
||
mkdir $WORK/bin | ||
go build -o $WORK/bin ./cmd/c1 ./cmd/c2 | ||
! stderr 'multiple packages' | ||
|
||
! go build -o $WORK/bin ./pkg1 ./pkg1 | ||
stderr 'no main packages' | ||
|
||
-- go.mod -- | ||
module exmod | ||
|
||
-- cmd/c1/main.go -- | ||
package main | ||
|
||
func main() {} | ||
|
||
-- cmd/c2/main.go -- | ||
package main | ||
|
||
func main() {} | ||
|
||
-- pkg1/pkg1.go -- | ||
package pkg1 | ||
|
||
-- pkg2/pkg2.go -- | ||
package pkg2 |