when I execute below cmd:
go get k8s.io/[email protected]
it tells me: "go: k8s.io/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("k8s.io/client-go/v12")"
ok, then I changed the cmd to this:
go get k8s.io/[email protected]+incompatible
then again, it still tells me the same error: go: k8s.io/[email protected]+incompatible: invalid version: module contains a go.mod file, so module path must match major version ("k8s.io/client-go/v12")
one interesting thing puzzles me that if I add require k8s.io/client-go v12.0.0+incompatible to go.mod and then execute go mod tidy, then client-go v12.0.0 will be downloaded correctly.
My question is: how can I download this specific version of client-go via go get??
Go Version: v1.18
Not at all.
go getis for adding dependencies to your project.To download source code in a certain version from the internet use
git cloneandgit checkout.