diff options
author | Bryan C. Mills <bcmills@google.com> | 2022-07-18 12:09:47 -0400 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2022-08-17 16:11:11 +0000 |
commit | ea6cb02ae54fcf89026a2178720396f1277dd105 (patch) | |
tree | 82b2d445839bd4a6a01e6f5255828a382e0f6e57 /src/cmd/go/internal/modload/load.go | |
parent | bd1bff4e7aa1e417aaa617a7f10b1cff88a6e243 (diff) | |
download | go-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.go | 2 |
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)) } |