Go: proxy.golang.org:

Created on 29 Nov 2019  路  4Comments  路  Source: golang/go

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

FrozenDueToAge

Most helpful comment

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

Thanks @hyangah

All 4 comments

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

$ GOPROXY=direct go get github.com/mikefarah/[email protected]
go: finding github.com/mikefarah/yq v2.4.1
go get github.com/mikefarah/[email protected]: github.com/mikefarah/[email protected]: 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.

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..

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

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

Thanks @hyangah

Was this page helpful?
0 / 5 - 0 ratings