You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt""k8s.io/client-go/pkg/version"
)
funcmain() { fmt.Println(version.Get()) }
go mod download: k8s.io/client-go@v12.0.0+incompatible: invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required
[user@localhost trash]$ go get k8s.io/client-go@v12.0.0
go get: k8s.io/client-go@v12.0.0: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v12
[user@localhost trash]$ go run .
What did you expect to see?
main.go:6:2: missing go.sum entry for module providing package k8s.io/client-go/pkg/version (imported by test); to add:
go mod download k8s.io/client-go
What did you see instead?
While this may simply be more fallout from #34330, it seems like there is more going on. The fact that I am advised to go get test, a stdlib package, is maddenly confusing. Then it actually succeeds in injecting the incompatible version into my go.sum.
main.go:6:2: missing go.sum entry for module providing package k8s.io/client-go/pkg/version (imported by test); to add:
go get test
[user@localhost trash]$ go get test
go: warning: k8s.io/client-go@v12.0.0+incompatible: retracted by module author: pre-module versions are obsolete
go: to switch to the latest unretracted version, run:
go get k8s.io/client-go@latest
[user@localhost trash]$ go run .
v0.0.0-master+$Format:%h$
The text was updated successfully, but these errors were encountered:
The fact that I am advised to go get test, a stdlib package, is maddenly confusing.
The stdlib package is testing.
test is what you named your module, and thus also the name of the package at the root of that module. (We perhaps could have suggested go get . instead, but that would require some extra reverse-mapping.)
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Create the following
go.mod
file:Create the following
main.go
file:What did you expect to see?
What did you see instead?
While this may simply be more fallout from #34330, it seems like there is more going on. The fact that I am advised to
go get test
, a stdlib package, is maddenly confusing. Then it actually succeeds in injecting the incompatible version into mygo.sum
.The text was updated successfully, but these errors were encountered: