-
Notifications
You must be signed in to change notification settings - Fork 18.1k
cmd/go: reject module path beginning with slash #28389
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
Comments
To me it seems that denying full path in I would not be surprised to see this in a bootstrap script
|
For reference, In tests, I think we're using module paths that don't satisfy this check (e.g., the module path is a single word without a |
Trailing slashes should probably also be blocked. It works as long as you don't have sub packages. As soon as you try to import a sub package you get errors like which is mighty confusing series of comands
edit the go.mod file to remove the trailing slash from the build starts to work as expected. |
Change https://golang.org/cl/182560 mentions this issue: |
When mod init with given module path, validate that module path is a valid import path. Note that module.CheckImportPath is used, because module.CheckPath verifies that module path is something that "go get" can fetch, which is strictly stronger condition than "a valid module path". Updates #28389 Fixes #32644 Change-Id: Ia60f218dd7d79186f87be723c28a96d6cb63017e Reviewed-on: https://go-review.googlesource.com/c/go/+/182560 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
This is now rejected with |
Re #28336, we should
go mod init /absolute/path
.go.mod
that saysmodule /absolute/path
.If we'd done either of those (we should do both), then the confusing build errors in #28336 would not have happened.
The text was updated successfully, but these errors were encountered: