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

x/tools/gopls: suggests invalid package names #44680

seankhliao opened this issue Feb 28, 2021 · 1 comment

x/tools/gopls: suggests invalid package names #44680

seankhliao opened this issue Feb 28, 2021 · 1 comment


Copy link

@seankhliao seankhliao commented Feb 28, 2021

go: tip
gopls: v0.6.6

With module / directory names with - in them, gopls uses that directly as a suggested package name, which is invalid


@gopherbot gopherbot added this to the Unreleased milestone Feb 28, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Feb 28, 2021
@stamblerre stamblerre added this to To Do in gopls: v1.0.0 Feb 28, 2021
Copy link

@ShoshinNikita ShoshinNikita commented Apr 5, 2021

We can replace - with _. But there are other cases:

  • directory name starts with a digit
  • directory name contains one of these characters: -, . or ~
  • directory name contains invalid characters (whitespace, comma, etc.)

I think we can ignore the last case and don't show suggestions at all because it's not possible to import such packages ( But what is the expected behavior in other situations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants