Skip to content

cmd/go: list -u -m and get -u suggest downgrades from pseudo-versions after latest #30634

Closed
@leitzler

Description

@leitzler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions