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 (with GO111MODULE=on) is not grabbing the newest version of my software #32208

Closed
bravecorvus opened this issue May 23, 2019 · 5 comments

Comments

@bravecorvus
Copy link

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

$ go version
go version go1.12.5 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
GOARCH="amd64"
GOBIN="/Users/andrew/go/bin"
GOCACHE="/Users/andrew/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/andrew/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="/usr/local/bin/gcc-8"
CXX="/usr/local/bin/g++-8"
CGO_ENABLED="0"
GOMOD="/Users/andrew/Desktop/testvigo/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 -fmessage-length=0 -fdebug-prefix-map=/var/folders/2c/dff53p2915j5qx4w2vh4y47c0000gn/T/go-build068661935=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

mkdir testvoiceitmod && cd testvoiceitmod
go mod init testvoiceitmod
go get -u github.com/voiceittech/VoiceIt2-Go
cat go.mod

What did you expect to see?

module testvoiceitmod

go 1.12

require (
	github.com/stretchr/objx v0.2.0 // indirect
	github.com/voiceittech/VoiceIt2-Go v2.2.0 // indirect
)

because the latest release on Github is v2.2.0
releases

What did you see instead?

module testvoiceitmod

go 1.12

require (
	github.com/stretchr/objx v0.2.0 // indirect
	github.com/voiceittech/VoiceIt2-Go v1.2.1 // indirect
)

I guess this is pretty weird to me because the go module system worked fine until v1.2.1 (released Mar 19). Furthermore, we have minimal dependencies (the main library itself only uses the standard library, tests use testify).

@bravecorvus
Copy link
Author

Also, go get github.com/voiceittech/VoiceIt2-Go@latest is also grabbing v1.2.1

@neild
Copy link
Contributor

neild commented May 23, 2019

Each different major version of a module has a different module path (see the section "adding a dependency on a new major version" in https://blog.golang.org/using-go-modules), so the command to add the latest v2 version of the module would be:

go get -u github.com/voiceittech/VoiceIt2-Go/v2

@bravecorvus
Copy link
Author

I see. thanks. I didn't know

@thepudds
Copy link
Contributor

thepudds commented May 23, 2019

@gilgameshskytrooper It looks like you might have just updated your go.mod file to include a /v2 at the end of the module path on the first line?

If so, note that the /v2 version of VoiceIt2-Go seems to be depending on the v1 version of itself:

voiceittech/VoiceIt2-Go@1195039

module github.com/voiceittech/VoiceIt2-Go/v2

require (
	github.com/stretchr/testify v1.2.2
	github.com/voiceittech/VoiceIt2-Go v1.2.1
)

You might want to try https://github.com/marwan-at-work/mod to make the needed changes automatically.

(Some related issues include #32014, #31543)

@thepudds thepudds changed the title go get (with GO111MODULE=on) is not grabbing the newest version of my software cmd/go: go get (with GO111MODULE=on) is not grabbing the newest version of my software May 23, 2019
@bravecorvus
Copy link
Author

@thepudds Huh. You are right. Thanks for the tip

@golang golang locked and limited conversation to collaborators May 22, 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

4 participants