-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 get with ... fails in module mode #29363
Comments
There might be some overlap with #27215 (including #27215 (comment), which describes how the documentation uses |
I think this caued by this go/src/cmd/go/internal/modload/import.go Lines 254 to 270 in 73fb3c3
when go get -u github.com/google/codesearch/cmd/... , dir is $GOPATH/pkg/mod/github.com/google/codesearch@v1.1.0/cmd/... . So os.Open will return error . And then no go source be throwed and get failed with not found.
I just motify this func to this: haveGoFiles = haveGoFilesCache.Do(dir, func() interface{} {
if strings.HasSuffix(dir, "/..."){
dir = strings.TrimSuffix(dir, "/...")
tmp, err := filepath.Glob(dir+"/**/*.go")
if err != nil{
return false
}
return len(tmp) > 0
}
f, err := os.Open(dir)
... I did little test, to get
And it works. |
Change https://golang.org/cl/156757 mentions this issue: |
@bcmills any chance this could be fixed in 1.12, or backported into a 1.12.x release at a later time? It's great that with https://go-review.googlesource.com/c/go/+/148517, one can tell a program's users to install a specific version easily via I realise the plan is to fix it in 1.13, but that would mean easy install instructions would be delayed by six months, as one can't expect users to run on betas or master. |
@mvdan, it's not obvious to me whether the fix will be small or simple enough to backport. There have been two independent attempts so far, and both have some issues in the details of the semantics and implementation. (The interaction between wildcard-expansion and module resolution is, unfortunately, quite subtle.) |
Change https://golang.org/cl/171138 mentions this issue: |
This used to work and should ideally keep working.
The text was updated successfully, but these errors were encountered: