]> Cypherpunks repositories - gostls13.git/commit
cmd/go: write go.mod requirements more consistently for go 1.17+
authorJay Conrod <jayconrod@google.com>
Thu, 9 Sep 2021 16:38:55 +0000 (09:38 -0700)
committerJay Conrod <jayconrod@google.com>
Mon, 20 Sep 2021 18:41:57 +0000 (18:41 +0000)
commit3c764babe7b5e01a4e04b1a2c7975cdb5c5651a0
treeb2c4731167545e8e69b133476d8b21a0b766b7a5
parent6268468e024ce7fa063611b98a2f11f17fd4bad8
cmd/go: write go.mod requirements more consistently for go 1.17+

If go.mod declares 1.17 or higher, when the go command rewrites go.mod
(for example, after 'go mod tidy'), it will be more consistent about
moving requirements in two blocks, one containing only direct
requirements, and one containing only indirect requirements.

The go command will not move requirements into or out of a block with
comments. It may still update versions and "// indirect" comments, and
it may delete unneeded requirements though.

Fixes #47563
Fixes #47733

Change-Id: Ia6fb3e302be53097893abf01aa7cea60ac7b069a
Reviewed-on: https://go-review.googlesource.com/c/go/+/343432
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go.mod
src/cmd/go.sum
src/cmd/go/testdata/script/mod_all.txt
src/cmd/go/testdata/script/mod_retention.txt
src/cmd/go/testdata/script/mod_tidy_compat_ambiguous.txt
src/cmd/go/testdata/script/mod_tidy_compat_incompatible.txt
src/cmd/vendor/golang.org/x/mod/modfile/rule.go
src/cmd/vendor/modules.txt
src/go.mod