]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.cmdgo] cmd/go: provide a more helpful missing required module error in workspaces
authorMichael Matloob <matloob@golang.org>
Mon, 28 Jun 2021 19:48:03 +0000 (15:48 -0400)
committerMichael Matloob <matloob@golang.org>
Fri, 30 Jul 2021 22:29:52 +0000 (22:29 +0000)
commit47694b59eb30bfe6a1c12a2eaaf631a4e956b9c7
tree37f2aa8c6b76c71f7241ca604dbc02261e2ab960
parent90830699aee61a154e989b2d9f8ce3ff4eabbce1
[dev.cmdgo] cmd/go: provide a more helpful missing required module error in workspaces

If the user is in a workspace, they might not be in the main module
they need to run go get from to add a module that provides a missing
dependency. Figure out what that module is from the import stack (there
might be multiple but we pick according to the stack computed by
the loader for errors) and tell the user to cd to that directory
first in the message.

Change-Id: I7c919eb61ea3dd122334ff1acd2d7e817cad4b25
Reviewed-on: https://go-review.googlesource.com/c/go/+/334940
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/work.txt