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: unexpected version update when running go list -u -m #30634

Open
leitzler opened this Issue Mar 6, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@leitzler
Copy link
Contributor

leitzler commented Mar 6, 2019

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

$ go version
go version go1.12 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
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build305234165=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I added a new dependency with go get specifying a particular commit (or master in the example below). Then when I looked for upgradable modules using go list -u -m all, it suggest an older commit (tagged version) as upgrade.

Minimal example:

root@85abf31141f1:/go# mkdir -p /tmp/foo && cd /tmp/foo
root@85abf31141f1:/tmp/foo# go mod init foo
go: creating new go.mod: module foo
root@85abf31141f1:/tmp/foo# go get github.com/SermoDigital/jose@master
go: finding github.com/SermoDigital/jose master
go: downloading github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc
go: extracting github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc
root@85abf31141f1:/tmp/foo# go list -u -m all     
go: finding github.com/SermoDigital/jose v0.9.1
foo
github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc [v0.9.1]

What did you expect to see?

No recommendation since the recommended version is older/an earlier commit in the same branch.

What did you see instead?

A recommendation to downgrade. Also, running go get -u <module> downgrades it to the older version.

@bcmills bcmills added this to the Go1.13 milestone Mar 6, 2019

@bcmills bcmills self-assigned this Mar 6, 2019

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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.