diff options
author | Jay Conrod <jayconrod@google.com> | 2021-09-09 09:38:55 -0700 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2021-09-20 18:41:57 +0000 |
commit | 3c764babe7b5e01a4e04b1a2c7975cdb5c5651a0 (patch) | |
tree | b2c4731167545e8e69b133476d8b21a0b766b7a5 /src/cmd/go/testdata/script/mod_retention.txt | |
parent | 6268468e024ce7fa063611b98a2f11f17fd4bad8 (diff) | |
download | go-3c764babe7b5e01a4e04b1a2c7975cdb5c5651a0.tar.gz go-3c764babe7b5e01a4e04b1a2c7975cdb5c5651a0.zip |
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>
Diffstat (limited to 'src/cmd/go/testdata/script/mod_retention.txt')
-rw-r--r-- | src/cmd/go/testdata/script/mod_retention.txt | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cmd/go/testdata/script/mod_retention.txt b/src/cmd/go/testdata/script/mod_retention.txt index 481c10d2b7..9d30026459 100644 --- a/src/cmd/go/testdata/script/mod_retention.txt +++ b/src/cmd/go/testdata/script/mod_retention.txt @@ -83,14 +83,14 @@ require ( package x import _ "rsc.io/quote" -- go.mod.crlf -- -module m
-
-go 1.14
-
-require (
- rsc.io/quote v1.5.2
- rsc.io/testonly v1.0.0 // indirect
-)
+module m + +go 1.14 + +require ( + rsc.io/quote v1.5.2 + rsc.io/testonly v1.0.0 // indirect +) -- go.mod.unsorted -- module m @@ -141,10 +141,10 @@ module m go $goversion +require rsc.io/quote v1.5.2 + require ( - rsc.io/quote v1.5.2 + golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect rsc.io/sampler v1.3.0 // indirect rsc.io/testonly v1.0.0 // indirect ) - -require golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect |