]> Cypherpunks repositories - gostls13.git/commit
cmd/go: 'go get' should not delete binaries when run from $GOBIN
authorJay Conrod <jayconrod@google.com>
Tue, 25 Jun 2019 21:25:01 +0000 (17:25 -0400)
committerJay Conrod <jayconrod@google.com>
Wed, 26 Jun 2019 15:02:32 +0000 (15:02 +0000)
commit24f7d89a73b7bd77127a56e8a8552c48278d251b
treeddbc7bcb748d5a45ec71f2e4d0084268668ccde1
parent9bf62783d2fc3804fd31f68092e779ef52f26cf9
cmd/go: 'go get' should not delete binaries when run from $GOBIN

When 'go install' is run without arguments in a directory containing a
main package, it deletes an executable file with the same name as the
package (presumably created by 'go build' previously).

'go get' in module mode executes the same code after updating and
downloading modules. However, the special case was misfiring because
we passed an empty list of patterns to InstallPackages.

Fixes #32766

Change-Id: I19aca64ee1fb5a216777dd7d559e8e6a45b3e90c
Reviewed-on: https://go-review.googlesource.com/c/go/+/183846
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modget/get.go
src/cmd/go/testdata/mod/example.com_tools_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_get_cmd.txt [new file with mode: 0644]