diff options
author | Sam Xie <xsambundy@gmail.com> | 2020-09-17 02:59:28 +0000 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2020-09-17 15:51:14 +0000 |
commit | 07d5eb075b6f270ae4443e9689821d2e403b72b5 (patch) | |
tree | e069baec85a37a64d3d731a99d1c53c3cbd08c1c /src/cmd/go/alldocs.go | |
parent | 0f7ac9b4f5f6bc20344feb8a2c32b8126df80baa (diff) | |
download | go-07d5eb075b6f270ae4443e9689821d2e403b72b5.tar.gz go-07d5eb075b6f270ae4443e9689821d2e403b72b5.zip |
cmd/go: allow output in non-existent directory
When 'go build' is given an output path with -o, if the output path
ends with a path separator, always treat it as a directory.
Fixes #41313
Change-Id: I9a9c25448abfcd6297ad973f5ed2025b2568a4a7
GitHub-Last-Rev: 20a19bd63a2779a2c94b0efdf86146ffd551293c
GitHub-Pull-Request: golang/go#41314
Reviewed-on: https://go-review.googlesource.com/c/go/+/253821
Run-TryBot: Jay Conrod <jayconrod@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/alldocs.go')
-rw-r--r-- | src/cmd/go/alldocs.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index b7e5bbed2d..5f1c7aaecb 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -93,8 +93,9 @@ // // The -o flag forces build to write the resulting executable or object // to the named output file or directory, instead of the default behavior described -// in the last two paragraphs. If the named output is a directory that exists, -// then any resulting executables will be written to that directory. +// in the last two paragraphs. If the named output is an existing directory or +// ends with a slash or backslash, then any resulting executables +// will be written to that directory. // // The -i flag installs the packages that are dependencies of the target. // |