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: can't get mod by version "vx.x" #27528

Closed
fancygo opened this issue Sep 6, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@fancygo
Copy link

commented Sep 6, 2018

Please answer these questions before submitting your issue. Thanks!

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

cspenrty

Does this issue reproduce with the latest release?

no

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fancy/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/fancy/gopkg"
GOPROXY=""
GORACE=""
GOROOT="/home/fancy/go"
GOTMPDIR=""
GOTOOLDIR="/home/fancy/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/fancy/fancy.module/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build847469475=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I create a mod, then create tag v1.0.0 and v1.0
When I set mod require v1.0.0, the program will build success. When I set require v1.0, it will build error.

What did you expect to see?

build success

What did you see instead?

invalid module version "v1.0": no matching versions for query "v1.0"

@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 6, 2018

I create a mod, then create tag v1.0.0 and v1.0

v1.0.0 is a valid semantic version (according to https://semver.org/), whereas v1.0 is not.

For v1.0, the go tool should try to resolve the version prefix to a valid semantic-version tag: if you have the tag v1.0.0 in the repo and run go get $pkg@v1.0, it should add a require directive for version v1.0.0.

It's not clear from your report whether that is working as intended or not. Please provide more detail: it's best if you can provide a sequence of runnable commands (and complete files) that reliably reproduce the problem.

@bcmills bcmills changed the title go1.11 module, can't get mod by version "vx.x" cmd/go: can't get mod by version "vx.x" Sep 6, 2018

@fancygo

This comment has been minimized.

Copy link
Author

commented Sep 7, 2018

I do as you told "go get $pkg@v1.0", then it can build succes. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.