Skip to content
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

proxy.golang.org: #35899

Closed
mikefarah opened this issue Nov 29, 2019 · 4 comments
Closed

proxy.golang.org: #35899

mikefarah opened this issue Nov 29, 2019 · 4 comments

Comments

@mikefarah
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.13.3 darwin/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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mikefarah/Library/Caches/go-build"
GOENV="/Users/mikefarah/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/mikefarah/dev/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/mikefarah/dev/go/src/github.com/mikefarah/yq/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bl/gjnr232n04ddh2kqnkg8q_nh0000gn/T/go-build615949050=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go list -m --versions github.com/mikefarah/yq

What did you expect to see?

v2.4.1 available

What did you see instead?

v2.4.0 and below

@hyangah
Copy link
Contributor

hyangah commented Nov 29, 2019

v2.4.1 is an invalid version so the proxy.golang.org couldn't use it.

$ GOPROXY=direct go get github.com/mikefarah/yq@v2.4.1
go: finding github.com/mikefarah/yq v2.4.1
go get github.com/mikefarah/yq@v2.4.1: github.com/mikefarah/yq@v2.4.1: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

This version validation rule is new in go1.13 (https://golang.org/doc/go1.13#modules Version validation).

Will see the same result without proxy.golang.org. (i.e., GOPROXY=direct)
FYI: with go1.14, those v2.x.x+incompatible will be dropped from the list output, and v1.15.0 be the latest one. (See "+incompatible versions" of https://tip.golang.org/doc/go1.14#go-command )

Closing this since it's working as intended.

@hyangah hyangah closed this as completed Nov 29, 2019
@mikefarah
Copy link
Author

Sorry - I read that documentation and I don't understand it.

How am I supposed to fix this? I thought we were supposed to use go.mod - but the doco seems to suggest not to use it?

Very confused..

@hyangah
Copy link
Contributor

hyangah commented Nov 30, 2019

The error message indicates its go.mod file declares the module name module github.com/mikefarah/yq. According to the semantic import versioning convention (https://research.swtch.com/vgo-import), it should be github.com/mikefarah/yq/v2 to be recognized as v2. https://blog.golang.org/v2-go-modules describes how to publish vN (N > 1).

But I am not sure, though, if that's sufficient to completely fix the issue you mentioned.

Have you tried to visit the Gophers' # modules slack channel? I heard a lot of experienced, kind, helpful gophers gather there.

@tbpg @jadekler @bcmills @jayconrod

@mikefarah
Copy link
Author

Updating the module to github.com/mikefarah/yq/v2 worked!

Thanks @hyangah

@golang golang locked and limited conversation to collaborators Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants