Skip to content

cmd/go: mod download and go mod tidy conflict (1.16beta1 -> 1.16rc1 regression) #43994

Closed
@howardjohn

Description

@howardjohn

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

$ go version
go1.16rc1

Does this issue reproduce with the latest release?

Yes, it is only present in go1.16rc1, and not go1.16beta1

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/howardjohn/.cache/go-build"
GOENV="/home/howardjohn/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/howardjohn/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/howardjohn/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/howardjohn/sdk/go1.16rc1"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/howardjohn/sdk/go1.16rc1/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16rc1"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/howardjohn/go/src/istio.io/api/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-build1862906774=/tmp/go-build -gno-record-gcc-switches"

What did you do?

On 1.16beta1:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

$ ~/go/bin/go1.16beta1 mod download
$ git status
On branch master
Your branch is up to date with 'origin/master'.

On 1.16rc1:

$ git status
On branch master
Your branch is up to date with 'origin/master'.
$ ~/go/bin/go1.16rc1 mod download
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   go.sum

$ ~/go/bin/go1.16rc1 mod tidy
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Repo: https://github.com/istio/api

What did you expect to see?

Either go mod download does not add to go.sum, OR go mod tidy keeps what is added by go mod download. In either case, the two tools should be consistent

What did you see instead?

go mod download adds to go.sum, which go mod tidy removes

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsInvestigationSomeone 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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions