]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: in 'go get', promote named implicit dependencies to explicit
authorJay Conrod <jayconrod@google.com>
Wed, 16 Dec 2020 21:37:56 +0000 (16:37 -0500)
committerJay Conrod <jayconrod@google.com>
Wed, 23 Dec 2020 14:16:32 +0000 (14:16 +0000)
commit98a73030b01cc23a292934d09f137a2befa439bf
treea2b481a011582f0f1bc6b7968128c16e7e1b8688
parentfd6ba1c8a23d8a3fffb6c475b21f78510152ef5c
cmd/go: in 'go get', promote named implicit dependencies to explicit

'go get pkg@vers' will now add an explicit requirement for the module
providing pkg if that version was already indirectly required.

'go get mod@vers' will do the same if mod is a module path but not a
package.

Requirements promoted this way will be marked "// indirect" because
'go get' doesn't know whether they're needed to build packages in the
main module. So users should prefer to run 'go get ./pkg' (where ./pkg
is a package in the main module) to promote requirements.

Fixes #43131

Change-Id: Ifbb65b71274b3cc752a7a593d6ddd875f7de23b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/278812
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/query.go
src/cmd/go/internal/str/str.go
src/cmd/go/testdata/script/mod_get_promote_implicit.txt