go: cmd/go: 'go get @' should not fall back to 'latest' if does not provide
What version of Go are you using (go version
)?
go version go1.11.2 windows/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\kdlij\AppData\Local\go-build set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=D:/testmod/ set GOPROXY= set GORACE= set GOROOT=C:\Go set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=D:\testclient\go.mod set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\kdlij\AppData\Local\Temp\go-build439133958=/tmp/go-build -gno-record-gcc-switches
What did you do?
Outside $GOPATH,
kidlj@collie MINGW64 /d/testclient $ go mod init github.com/kidlj/test go: creating new go.mod: module github.com/kidlj/test kidlj@collie MINGW64 /d/testclient $ cat go.mod module github.com/kidlj/test kidlj@collie MINGW64 /d/testclient $ go get k8s.io/client-go@kubernetes-1.12.3 go: finding k8s.io/client-go kubernetes-1.12.3 kidlj@collie MINGW64 /d/testclient $ cat go.mod module github.com/kidlj/test require k8s.io/client-go v2.0.0-alpha.0.0.20181126152608-d082d5923d3c+incompatible // indirect
What did you expect to see?
In go.mod:
require k8s.io/client-go v0.0.0-alpha.0.0.20181126152608-d082d5923d3c+incompatible // indirect
What did you see instead?
n go.mod:
require k8s.io/client-go v2.0.0-alpha.0.0.20181126152608-d082d5923d3c+incompatible // indirect
The question is:
How is the requested version(@kubernetes-1.12.3
), also 20181126152608-d082d5923d3c
related with v2.0.0-alpha
?
The kubernetes/client-go releases page is here: https://github.com/kubernetes/client-go/tags
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 17 (10 by maintainers)
This does indeed seem to be fixed at head.
With
go version devel +b8c545dc45 Thu May 16 17:42:30 2019 -0400 linux/amd64
I get the following when gettingapimachinery
:Maybe the issue of falling back to
latest
was fixed?My understanding is that I’ve run into a similar situation using another package, gonum. It appears that
gonum.org/v1/gonum
is not a package (there are no.go
files atgonum.org/v1/gonum
) at the commit set in@<revision>
.The following results in fetching the latest when I expected it to fetch
@<revision>
.Difference after running
go get
.These two alternatives result in the expected version being set.
It is unclear to me if this is related or if another issue is required. Running
go mod tidy
results in the gonum module being set to latest thus bumping thegonum/v1/gonum/mat
package to latest as well.References:
Close. The
-m
flag tells it to fetch a module rather than a package. (Without-m
the paths are interpreted as package paths, and with-m
they are interpreted as module paths.)Correct.