]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add a Go source file in TestScript/mod_sumdb
authorBryan C. Mills <bcmills@google.com>
Mon, 12 Apr 2021 14:41:56 +0000 (10:41 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 14 Apr 2021 21:50:26 +0000 (21:50 +0000)
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>
src/cmd/go/testdata/script/mod_sumdb.txt

index 9a688e1461ca94efdce410cafbc9d4f06146fd1d..fa3483c5cb1a510b9d5c19cbf16c4bdf116f155d 100644 (file)
@@ -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"