-
Notifications
You must be signed in to change notification settings - Fork 646
Package name suggestion contains bad characters #796
Comments
See #647 (comment) where I have put my thoughts on the subject. That particular issue was closed as I added a solution for packages from gopkg.in as they specifically start wit "gopkg.in" end in ".v1" or v2 etc. I think the best solution would be to update Logged tpng/gopkgs#5 for the same. Perhaps, you can give it a try? |
As suggested tpng/gopkgs#5 (comment), it would be an overkill to implement this in The output of We can run So net result is that, may be for a few seconds of initial coding, you will see the directory name as package name, and after a while (how much ever time cc @AlekSi including you here, as you first raised this issue. |
It's sound like a good solution to use When I create a new package I don't have any go files and when I create my first go file |
Looks like I went off on a different tangent... @frozzare you are talking about the specific case when user types Whereas the issue I linked is about the when you try to use an existing package (but unimported) which maybe in a folder You are right, new packages will not show up in For your case, we can use regex to check if the directory name is a valid package name. If yes, then we suggest it, if not then we don't suggest anything at all. Thoughts? |
Yeah that would work since it's better to suggest package name that actually are valid than package names that isn't valid :) |
@ramya-rao-a sweet 👍 |
The suggested package name is built up on the directory name, but if the directory name contains a prefix, e.g
go-
the suggested package name will bego-mypack
and that isn't allowed as a package name and it's not just a dash that don't work in a package name, e.g dot will not work either.I don't have a good solution how to fix this since you don't want to confuse the user, but maybe some option that a user can configure what to strip from the suggested package name?
The text was updated successfully, but these errors were encountered: