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
Labels
modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@stamblerre
Copy link
Contributor

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 cagedmantis added this to the Backlog milestone Jan 15, 2020
@cagedmantis cagedmantis added NeedsFix The path to resolution is known, but the work has not been done. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 15, 2020
@gopherbot gopherbot removed the NeedsFix The path to resolution is known, but the work has not been done. label Jan 15, 2020
@cagedmantis
Copy link
Contributor

/cc @bcmills @jayconrod

@jayconrod
Copy link
Contributor

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
Labels
modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants