go: cmd/go: go get golang/x/tools/...: no matching versions for query "latest"
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error. A complete runnable program is good. A link on play.golang.org is best.
go get golang.org/x/tools/…
What did you expect to see?
success
What did you see instead?
⎣ ⇨ go get -u -v golang.org/x/tools/… Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) get “golang.org/x/tools”: found meta tag get.metaImport{Prefix:“golang.org/x/tools”, VCS:“git”, RepoRoot:“https://go.googlesource.com/tools”} at https://golang.org/x/tools?go-get=1 go: finding golang.org/x/tools/… latest Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) get “golang.org/x/tools”: found meta tag get.metaImport{Prefix:“golang.org/x/tools”, VCS:“git”, RepoRoot:“https://go.googlesource.com/tools”} at https://golang.org/x/tools?go-get=1 go: finding golang.org/x/tools latest Fetching https://golang.org/x?go-get=1 Parsing meta tags from https://golang.org/x?go-get=1 (status code 200) Fetching https://golang.org?go-get=1 Parsing meta tags from https://golang.org?go-get=1 (status code 200) go get golang.org/x/tools/…: no matching versions for query “latest”
System details
go version go1.11 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/scott/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/scott/Dev/zic"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/scott/Dev/zic/src/zikichombo.org/sound/go.mod"
GOROOT/bin/go version: go version go1.11 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.11
uname -v: Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64
ProductName: Mac OS X
ProductVersion: 10.13.6
BuildVersion: 17G65
lldb --version: lldb-902.0.79.7
Swift-4.1
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 11
- Comments: 22 (13 by maintainers)
I had the same (or very similar) problem building a module and using
GO111MODULE=off
wasn’t an option for me since I wanted to use modules. I solved this runninggo clean -modcache
.HACK: For what it’s worth, the following succeeds after the first attempt to
go get
without “…”:I discovered this when struggling to get
go generate
to work for go-bindataIn my case, the first line is necessary for the following to succeed:
Hope this helps anyone else.
EDIT: My bad – I didn’t notice that the solution was already mentioned in this previous comment when I skimmed through this the first time. I was going to delete my comment, but decided that it might still be helpful to anyone landing here and missing the earlier comment like I did.
This breaks the workflow of installing go from source because installing additional tools doesn’t work if
GO111MODULE=on
has been set. I ran into this when re-installing Go from source and my work around was to turn off the setting first first, install & then turn it back on. While not many folks will run into this, a note should probably be added to the documentation on installing from source noting the issue.I’ve seen this error in the wild, given some packages include
go get foo/...
in their install instructions.That said, the official documentation seems to claim that this works. In particular,
go get golang.org/x/perf/cmd/...
is actually cited as example in the official documentation for ‘Module aware go get’, but if you try that example from the doc, it fails with errorno matching versions for query "latest"
:From https://tip.golang.org/cmd/go/#hdr-Module_aware_go_get
Here is that example from the doc from scratch:
Note that you can get it to work though if you first do
go get golang.org/x/perf/cmd/benchstat
, and then repeat the exact previously failing command.Continuing prior example:
I’m guessing that second example works because
golang.org/x/perf
becomes part of the active modules prior to doinggo get golang.org/x/perf/cmd/...
.yes, it was. GO111MODULE=off works ok.
Also, GOMOD was set, which I think should mean it was enabled by some mechanism or other.
so, how to solve this kind of problem? "no matching versions for query “latest”
I think this can be closed after CL 174099 and other fixes to
go get
landed.go get golang.org/x/tools/...
should work now.Sorry I don’t think there was anything in here that could be backported to 1.12. The changes to
go get
semantics were pretty substantial. In general,go get
in 1.13 in module mode should have similar semantics togo get
in GOPATH mode.The example I had listed above in https://github.com/golang/go/issues/27215#issuecomment-427672781 seems to be fixed in tip now that #29363 is fixed.
Is anyone else still seeing an issue here if you try with tip?
go get golang.org/dl/gotip && gotip download
is a handy way to try with the latest from Go tip.Commenting to confirm that running
go get
without the/...
pattern first, then runninggo get
with the/...
pattern works. But I second the earlier comments that this is not in agreement with the documentation.@bigblind my first guess would be you might be seeing a separate issue, and perhaps one more specific to that
/v8
repo. (The fact that it includes/v8
could be confusing the interpretation of semantic import versioning, where the major version for a v2+ module appears in the import path and module path. That said, I had thought pre-existing repos that happened to include/vN
were already handled properly, but not sure… so perhaps there is an entirely different problem you are hitting).The original report in this issue is more related to
/...
appearing in thego get
command, I think, and that original report affects more repos.Just to get more of the standard details about your environment, etc., and to help track what you are reporting more closely, what would you think about opening a new issue?
You could include the output of
go get -v github.com/augustoroman/v8
and maybego get -x -v github.com/augustoroman/v8
. You could also include your git version.EDIT: the problem reported by @bigblind was in fact a separate issue and due to the
/v8
, which is tracked in #28435Same is happening here: