-
Notifications
You must be signed in to change notification settings - Fork 18k
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 accepts dotless module paths #36774
Comments
Module paths without a dot in the first path element are allowed, but they cannot be downloaded using that name. That means they cannot appear in a I don't think this documented anywhere. CL 214377 covers this. |
I think this will cause the term What is the definition of the term |
A It may or may not contain a dot. We should update the “malformed module path” error message to be clearer about what, exactly, is wrong. (The problem is not that the module path is malformed per se, but rather that paths of that form cannot be fetched to the module cache.) |
The problem is that it is not entirely true that a module path without a dot in the first path segment can not be fetched. It depends on the resolver. Consider an import path like |
No, it would not. Dotless import paths are in general reserved for the standard library: if they are not in the standard library, and not supplied via a (Otherwise the meaning of an import path could become nondeterministic based on the set of hostnames on the network, which seems way too subtle.) |
I tried with a module path
So I guess the term |
seems to be working as intended. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
go1.14beta1 is the latest release
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
The problem is that
go build
will report an error if another module add as requirementmperillo/test
.In this case, is there a reason to allow
go mod init
to accept such module path?The text was updated successfully, but these errors were encountered: