]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: cache parsed go.mod files globally
authorBryan C. Mills <bcmills@google.com>
Thu, 23 Jul 2020 04:45:27 +0000 (00:45 -0400)
committerBryan C. Mills <bcmills@google.com>
Mon, 24 Aug 2020 20:45:05 +0000 (20:45 +0000)
commita9146a49d0db666a7efd5f5d4555cf6117405cf5
treef4767ced3fd89434280a93cbc26b15d17d4a1e5b
parent2a9636dc2bdbb2865dde686352de528c6953c7bf
cmd/go/internal/modload: cache parsed go.mod files globally

Previously they were cached per mvsReqs instance. However, the
contents of the go.mod file of a given dependency version can only
vary if the 'replace' directives that apply to that version have
changed, and the only time we change 'replace' directives is in 'go
mod edit' (which does not care about the build list or MVS).

This not only simplifies the mvsReqs implementation, but also makes
more of the underlying logic independent of mvsReqs.

For #36460

Change-Id: Ieac20c2fcd56f64d847ac8a1b40f9361ece78663
Reviewed-on: https://go-review.googlesource.com/c/go/+/244774
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/modfile.go
src/cmd/go/internal/modload/mvs.go
src/cmd/go/testdata/script/mod_invalid_version.txt