-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: 'go mod init' should reject module paths that are not valid import paths #45025
Comments
We can't reject module paths that fail I thought we had fixed this in CL 211597, but I guess we missed something there. 😞 |
This may be as simple as adding ' '(space) to the one of the reject lists (it's really not a shell character or a fs character though). I wonder what other character may need to be blocked. |
Yes, this issue fixed in CL 211597 .
|
@oiooj, it's nice that |
(I think Now that we have separate validation for import paths, perhaps we should call |
Change https://golang.org/cl/320310 mentions this issue: |
With the suggested CL, space in a module name is rejected as expected.
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Tested on Go 1.16.2 and on tip
using gotip
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
An error about the import path not being correct due to the space and not have the
go.mod
file createdWhat did you see instead?
Also once trying to use the module then I get an error about the module name.
The text was updated successfully, but these errors were encountered: