aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/load.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2022-07-18 12:09:47 -0400
committerGopher Robot <gobot@golang.org>2022-08-17 16:11:11 +0000
commitea6cb02ae54fcf89026a2178720396f1277dd105 (patch)
tree82b2d445839bd4a6a01e6f5255828a382e0f6e57 /src/cmd/go/internal/modload/load.go
parentbd1bff4e7aa1e417aaa617a7f10b1cff88a6e243 (diff)
downloadgo-ea6cb02ae54fcf89026a2178720396f1277dd105.tar.gz
go-ea6cb02ae54fcf89026a2178720396f1277dd105.zip
cmd/go: propagate match errors in 'go run'
Fixes #51604. Change-Id: I3bc86652c62d2b329d9c2db5ea443d56cf17f8d1 Reviewed-on: https://go-review.googlesource.com/c/go/+/418094 Reviewed-by: Nooras Saba‎ <saba@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/load.go')
-rw-r--r--src/cmd/go/internal/modload/load.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go
index ba85dc2438..a36ac9c5bb 100644
--- a/src/cmd/go/internal/modload/load.go
+++ b/src/cmd/go/internal/modload/load.go
@@ -607,7 +607,7 @@ func resolveLocalPackage(ctx context.Context, dir string, rs *Requirements) (str
if pkg == "" {
if inWorkspaceMode() {
if mr := findModuleRoot(absDir); mr != "" {
- return "", fmt.Errorf("directory %s is contained in a module that is not one of the workspace modules listed in go.work. You can add the module to the workspace using go work use %s", base.ShortPath(absDir), base.ShortPath(mr))
+ return "", fmt.Errorf("directory %s is contained in a module that is not one of the workspace modules listed in go.work. You can add the module to the workspace using:\n\tgo work use %s", base.ShortPath(absDir), base.ShortPath(mr))
}
return "", fmt.Errorf("directory %s outside modules listed in go.work or their selected dependencies", base.ShortPath(absDir))
}