-
Notifications
You must be signed in to change notification settings - Fork 17.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go/internal/modload: cache the Go language version for each modul…
…e globally Previously, this cache was a member of the (ephemeral) modload.loader struct. However, the Go language version for a given module version does not vary based on the build list, the set of loaded packages, the build tags in use, the meaning of the "all" pattern, or anything else that can be configured for an instance of the package loader. The map containing that information is therefore not appropriate as a field of the (configurable, package-list-dependent) loader struct. The Go language version mapping could, in theory, be read from the go.mod file in the module cache (or replacement directory) every time it is needed: this map is just a cache, and as such it belongs alongside the other caches and indexes in the modload package, which are currently found in modfile.go. We may want to do the same sort of global caching for the mapping from each module.Version to its list of direct requirements (which are similarly idempotent), but for now that is left for a future change. For #36460 For #36876 Change-Id: I90ac176ffea97f30c47d6540c3dfb874dc9cfa4f Reviewed-on: https://go-review.googlesource.com/c/go/+/244078 Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
- Loading branch information
Bryan C. Mills
committed
Aug 24, 2020
1 parent
c777863
commit 2a9636d
Showing
4 changed files
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters