]> Cypherpunks repositories - gostls13.git/commit
cmd/go: make 'go get' match patterns against packages, not modules
authorJay Conrod <jayconrod@google.com>
Thu, 9 May 2019 19:42:55 +0000 (15:42 -0400)
committerJay Conrod <jayconrod@google.com>
Mon, 13 May 2019 19:29:47 +0000 (19:29 +0000)
commit71be83e8ca660c375592683bf71de8864a8464c5
treeab426c6f27ba53cc90fbf2cd0ed22cebaeee369e
parented7a92bab459806c958459264f8c88495ea6c4ba
cmd/go: make 'go get' match patterns against packages, not modules

This is a follow-up to CL 174099, fixing an important TODO.
The 'go help modget' documentation will be clarified in anotehr CL,
pending further discussion.

When invoked without -m, 'go get' will no longer match arguments
containing "..." against module paths. If a module's path matches a
pattern but no packages within the module match the pattern, the
module should not be upgraded. For example, if
golang.org/x/tools/playground and golang.org/x/tools are separate
modules, and only golang.org/x/tools is in the build list,
'go get golang.org/x/tools/playground/...' should add
golang.org/x/tools/playground to the build list and leave
golang.org/x/tools alone.

Updates #26902

Change-Id: I2bd18c7950db1aa7bd8527210c1baf2c7d174375
Reviewed-on: https://go-review.googlesource.com/c/go/+/176578
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modget/get.go
src/cmd/go/testdata/mod/example.com_nest_sub_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_nest_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_nest_v1.1.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_get_main.txt
src/cmd/go/testdata/script/mod_get_patterns.txt