]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: make fewer 'go mod' commands update go.mod
authorJay Conrod <jayconrod@google.com>
Tue, 20 Jul 2021 21:46:40 +0000 (14:46 -0700)
committerJay Conrod <jayconrod@google.com>
Fri, 13 Aug 2021 00:19:50 +0000 (00:19 +0000)
commit4be75faa3ee79a273ff82d4f5b7f838ef3642f9d
tree3da569506b191359f7931a1435a3f2b3939a2605
parent1fffeddfe9c977510d855277da57e0564700d6c3
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>
Reviewed-on: https://go-review.googlesource.com/c/go/+/341933
Reviewed-by: Bryan C. Mills <bcmills@google.com>
13 files changed:
src/cmd/go/internal/modload/init.go
src/cmd/go/testdata/script/mod_all.txt
src/cmd/go/testdata/script/mod_e.txt
src/cmd/go/testdata/script/mod_get_commit.txt
src/cmd/go/testdata/script/mod_getmode_vendor.txt
src/cmd/go/testdata/script/mod_list_retract.txt
src/cmd/go/testdata/script/mod_retention.txt
src/cmd/go/testdata/script/mod_tidy_error.txt
src/cmd/go/testdata/script/mod_vendor_replace.txt
src/cmd/go/testdata/script/mod_vendor_trimpath.txt
src/cmd/go/testdata/script/mod_vendor_unused_only.txt
src/cmd/go/testdata/script/mod_verify.txt
src/cmd/go/testdata/script/modfile_flag.txt