]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: skip reading go.mod files for imports in 'go mod tidy' of...
authorBryan C. Mills <bcmills@google.com>
Fri, 5 May 2023 20:50:56 +0000 (16:50 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 10 May 2023 14:36:26 +0000 (14:36 +0000)
commit46847c639b3e5b3df0c4b06fd19d1cc90bc0306e
treebd2616a15371107ea7d630406c2539541836e12c
parent8e8303e1d04d3368db568aada24b3ccd7f1b4fc4
cmd/go/internal/modload: skip reading go.mod files for imports in 'go mod tidy' of modules before 'go 1.21'

This eliminate a network access in 'go mod tidy' of an already-tidy
module, which would otherwise be needed to fetch go.mod checksums for
the test dependencies whose go.mod checksums were omitted in Go
releases between Go 1.17 and 1.20 due to bug #56222.

For modules between 'go 1.17' and 'go 1.20' we intentionally preserve
the old 'go mod tidy' output (omitting go.sum entries for the go.mod
files of test dependencies of external packages). We should also avoid
performing extra sumdb lookups for checksums that would be discarded
anyway.

Updates #56222.

Change-Id: I7f0f1c8e902db0e3414c819621c4b99052f503f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/492741
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/mod_sum_issue56222.txt