]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go/internal/modload: add hint for missing implicit dependency
authorJay Conrod <jayconrod@google.com>
Tue, 22 Dec 2020 21:57:46 +0000 (16:57 -0500)
committerJay Conrod <jayconrod@google.com>
Tue, 22 Dec 2020 23:39:46 +0000 (23:39 +0000)
commit223331fc0cf5b23fbb9999eb1164b23695ef612a
tree430af57c24c25f15891e6e222bf9fe4f35006764
parentc9fb4eb0a22131cc9922fa96afba01d4e21d4fd4
cmd/go/internal/modload: add hint for missing implicit dependency

By default (and with -mod=readonly), the go command imports an error
if a package provided by an implicitly required module is
imported by a package in the main module. This import requires an
update to go.mod: the module must be required explicitly.

The package loader now provides a hint that 'go get' should be run on
the importing package. This is preferred to 'go get' on the imported
package, since that would add an "// indirect" requirement.

For #43131

Change-Id: I0b353ce8ac8c4ddf1a9863544dfaf6c1964daf42
Reviewed-on: https://go-review.googlesource.com/c/go/+/279528
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/mod_get_promote_implicit.txt [new file with mode: 0644]