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: confusing error message for invalid package path #36558

Open
stamblerre opened this issue Jan 14, 2020 · 2 comments
Open

cmd/go: confusing error message for invalid package path #36558

stamblerre opened this issue Jan 14, 2020 · 2 comments
Milestone

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jan 14, 2020

I made a mistake in gopls (corrected in CL 214717), which resulted in us passing multiple package paths as one argument to go list. The resulting error message did not make this easy to debug, as it wasn't clear that that was the issue.

-: module golang.org/x/tools@latest found (v0.0.0-20200114052453-d31a08c2edf2), but does not contain package golang.org/x/tools/internal/lsp/noparse_format golang.org/x/tools/internal/lsp/folding

It should be pretty obvious that a package path with a space is invalid, but it's not obvious what's going wrong from the error message.

@cagedmantis

This comment has been minimized.

Copy link
Contributor

@cagedmantis cagedmantis commented Jan 15, 2020

@jayconrod

This comment has been minimized.

Copy link
Contributor

@jayconrod jayconrod commented Jan 17, 2020

cc @matloob

We should do more validation of package paths. We should decide exactly what should be allowed in package paths before tightening that up though. golang.org/x/mod/module.CheckImportPath is very restrictive, and it may break some projects if we use it as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.