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

cmd/go: go get can't fetch correct revision for version-alike tags #44682

Closed
gudvinr opened this issue Feb 28, 2021 · 1 comment
Closed

cmd/go: go get can't fetch correct revision for version-alike tags #44682

gudvinr opened this issue Feb 28, 2021 · 1 comment

Comments

@gudvinr
Copy link

gudvinr commented Feb 28, 2021

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

$ go version
go version go1.16 linux/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="~/.cache/go-build"
GOENV="~/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="~/tools/go/path/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="~/tools/go/path"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1390191991=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Within go module directory I am trying to go get package using @tag specifier:

go get -v github.com/asaskevich/govalidator@v11

This repository has tag v11 but it does not have v11.X.Y tags which go requires to use as version since part after v isn't semver.

What did you expect to see?

go get: added github.com/asaskevich/govalidator v0.0.0-pseudo-tag-that-corresponds-to-v11-tag

Since v11 is a valid tag and not semver-compliant version, it is expected to behave in same way as any other tag that owner might want to use.
Or, if go treats v11 as valid version it should import package as github.com/asaskevich/govalidator/v11 despite v11 being invalid semver identifier.

What did you see instead?

go get github.com/asaskevich/govalidator@v11: no matching versions for query "v11"
@seankhliao
Copy link
Member

vX is a version query bullet point 2

point 3:

Note that branches and tags with names matched by other version queries cannot be selected this way. For example, the query v2 selects the latest version starting with v2, not the branch named v2.

Closing as working as intended

@golang golang locked and limited conversation to collaborators Feb 28, 2022
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