mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
cmd/go: add a Go source file in TestScript/mod_sumdb
This test expects 'go mod tidy' to fail if the existing module graph has a bad checksum. However, there is no intrinsic reason why 'go mod tidy' should fail in that case: the module contains no packages, and thus no imports, so 'go mod tidy' can justifiably remove all requirements without regard to any errors that may have already been present in the module graph. Adding a source file that imports a package from the module with the bad checksum should guarantee that 'go mod tidy' reports the checksum eror. For #36460 Change-Id: I59734ac524031288bc03a11f58eed5abe2db76b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/309334 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
parent
23f8c203f0
commit
cbf9caaf22
1 changed files with 6 additions and 0 deletions
6
src/cmd/go/testdata/script/mod_sumdb.txt
vendored
6
src/cmd/go/testdata/script/mod_sumdb.txt
vendored
|
@ -37,3 +37,9 @@ go get -d rsc.io/fortune
|
|||
|
||||
-- go.mod.orig --
|
||||
module m
|
||||
|
||||
go 1.16
|
||||
-- m.go --
|
||||
package m
|
||||
|
||||
import _ "rsc.io/quote"
|
||||
|
|
Loading…
Reference in a new issue