-
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: Can't go get github.com/augustoroman/v8
#28435
Comments
I've confirmed that the |
I've tried coding a script using the GitHub regex (see https://go.googlesource.com/go/+/go1.11.1/src/cmd/go/internal/get/vcs.go#983). package main
import "regexp"
import "fmt"
func main() {
var kregexp *regexp.Regexp
reg :=
`^(?P<root>github\.com/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[\p{L}0-9_.\-]+)*$`
kregexp = regexp.MustCompile(reg)
firstMatch, secondMatch := kregexp.FindStringSubmatch("github.com/hearot/ArgoScuolaNext-Go"),
kregexp.FindStringSubmatch("github.com/augustoroman/v8")
firstMatchMap := map[string]string{}
secondMatchMap := map[string]string{}
for i, name := range kregexp.SubexpNames() {
if name != "" && firstMatchMap[name] == "" {
firstMatchMap[name] = firstMatch[i]
}
}
for i, name := range kregexp.SubexpNames() {
if name != "" && secondMatchMap[name] == "" {
secondMatchMap[name] = secondMatch[i]
}
}
fmt.Printf("First match: %s", firstMatchMap)
fmt.Println()
fmt.Printf("Second match: %s", secondMatchMap)
} And I got this:
That regex works perfectly, there are no errors. So, I've also tried to do the |
/cc @myitcv |
Last time I saw comment on this, @rsc's thoughts were that such a case is extremely rare, and hence renaming the package is the solution (per @bigblind): https://go-review.googlesource.com/c/vgo/+/122399/5/vendor/cmd/go/internal/modfetch/coderepo.go#307 |
Yes, sorry. My suggestion is v8js. |
This is not extremely rare. This will effect like half of the K8s libraries. |
The Kubernetes project uses versions as their package names today, and they have some reaching the point of v2. This suspect this issue could cause major disruptions in the Kubernetes ecosystem if they needed to change how code is structured or named, especially in relation to people trying use it with modules. Based on recent experiences with gofrs/uuid around SIV, I anticipate this will not be a great experience without fully investigating the ramifications of this change in the ecosystem. Can we please have this issue re-opened, is there anyone from the Kubernetes project who we can loop-in for an official perspective as well? |
@theckman, @mattmoor, note that the restriction is on module paths that end in https://godoc.org/?q=k8s.io+v2 doesn't show any packages ending in |
@theckman , @mattmoor, to slightly expand on that comment from @bcmills (with the intent of trying to explain at least briefly -- "well, what is the difference between a module path vs. a package path?") For most projects, the module path is the repo (e.g., For example, if you are creating a module for a repository
More generally, the import paths for all packages in a module share the module path as a common prefix. A module declares its identity in its |
thanks, that is definitely less worrying. |
One thing I wanted to add for anyone coming across this issue is that I found out that if I |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I think I have the latest release
What operating system and processor architecture are you using (
go env
)?macOS 10.13.4
What did you do?
What did you expect to see?
I expected the
v8
package to be downloaded and installed.What did you see instead?
The output from the command above.
I originally posted about this in #27215, but was asked to create a separate issue, because this might be a problem where go sees the package name (v8) as a version indicator.
Environment:
GO111MODULES
is not set.The text was updated successfully, but these errors were encountered: