Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: improve error message when working in a module that's outside of #49632

hyangah opened this issue Nov 17, 2021 · 1 comment


Copy link

@hyangah hyangah commented Nov 17, 2021

$ go version
go version devel go1.18-3d7cb23e3d Wed Nov 17 01:56:19 2021 +0000 darwin/amd64

When running a go command in a directory whose parent directory defines but does not include this directory in its use section, the go command output is rather confusing.

$ ls
$ cat
go 1.18

use delve
$ cd tools; go list ./...
pattern ./...: directory prefix . outside available modules

Even though users can check go env GOWORK, consider to explicitly mention the existence of
(maybe something like pattern ./...: directory prefix . outside modules listed in

Or, let it operate in a single module mode as if there is no - but not sure which one is less confusing.

Copy link

@bcmills bcmills commented Nov 17, 2021


@bcmills bcmills added this to the Go1.18 milestone Nov 17, 2021
@matloob matloob self-assigned this Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants