aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/modfile_flag.txt
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2021-07-20 14:46:40 -0700
committerJay Conrod <jayconrod@google.com>2021-07-27 23:11:42 +0000
commit2c8acf63c233430f8fb48f37c6ec54a29bd53c28 (patch)
treefa07c14da189c23aa3b554b38f55410ff45d0639 /src/cmd/go/testdata/script/modfile_flag.txt
parent72233d27c4dcbbbbb53f06bdafd4a0fb8d652662 (diff)
downloadgo-2c8acf63c233430f8fb48f37c6ec54a29bd53c28.tar.gz
go-2c8acf63c233430f8fb48f37c6ec54a29bd53c28.zip
[dev.cmdgo] cmd/go: make fewer 'go mod' commands update go.mod
'go mod graph', 'go mod vendor', 'go mod verify', and 'go mod why' will no longer edit go.mod or go.sum. 'go mod graph', 'go mod verify', and 'go mod why' may still fetch files and look up packages as if they were able to update go.mod. They're useful for debugging and should still work when go.mod is a little broken. This is implemented in modload.setDefaultBuildMod based on command name for now. Super gross. Sorry. This should be fixed with a larger refactoring for #40775. Fixes golang/go#45551 Change-Id: If5f225937180d32e9a5dd252c78d988042bbdedf Reviewed-on: https://go-review.googlesource.com/c/go/+/336151 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
Diffstat (limited to 'src/cmd/go/testdata/script/modfile_flag.txt')
-rw-r--r--src/cmd/go/testdata/script/modfile_flag.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/go/testdata/script/modfile_flag.txt b/src/cmd/go/testdata/script/modfile_flag.txt
index 5852c31189..7cce581e55 100644
--- a/src/cmd/go/testdata/script/modfile_flag.txt
+++ b/src/cmd/go/testdata/script/modfile_flag.txt
@@ -24,6 +24,11 @@ stdout '^go.alt.mod$'
go mod edit -require rsc.io/quote@v1.5.2
grep rsc.io/quote go.alt.mod
+# 'go list -m' should add sums to the alternate go.sum.
+go list -m -mod=mod all
+grep '^rsc.io/quote v1.5.2/go.mod ' go.alt.sum
+! grep '^rsc.io/quote v1.5.2 ' go.alt.sum
+
# other 'go mod' commands should work. 'go mod vendor' is tested later.
go mod download rsc.io/quote
go mod graph