]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] cmd/go: write go.mod requirements more consistently for go...
authorJay Conrod <jayconrod@google.com>
Thu, 9 Sep 2021 16:38:55 +0000 (09:38 -0700)
committerHeschi Kreinick <heschi@google.com>
Tue, 28 Sep 2021 20:30:45 +0000 (20:30 +0000)
commit04242ac88fc16aca0353ed37a5eacef86a2eba98
treee722d67fd0e85a7c29bbb2f2ffb2f6591709558c
parentc5c1d069da73a5e74bd2139ef1c7c14659915acd
[release-branch.go1.17] 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 #47756

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>
(cherry picked from commit 3c764babe7b5e01a4e04b1a2c7975cdb5c5651a0)
Reviewed-on: https://go-review.googlesource.com/c/go/+/351465
TryBot-Result: Go Bot <gobot@golang.org>
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