aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-06-10 12:03:06 -0400
committerRuss Cox <rsc@golang.org>2022-07-05 12:57:45 +0000
commit5f305ae8e5796ea3821088863a6842117c58da72 (patch)
treeef0b79878e83bbf59b44761a8c4013f0560fd2e6 /src/os/exec/exec.go
parent84e091eef033255b4a3fdb515d677faa135714dc (diff)
downloadgo-5f305ae8e5796ea3821088863a6842117c58da72.tar.xz
cmd/go: add -reuse flag to make proxy invocations more efficient
The go list -m and go mod download commands now have a -reuse flag, which is passed the name of a file containing the JSON output from a previous run of the same command. (It is up to the caller to ensure that flags such as -versions or -retracted, which affect the output, are consistent between the old and new run.) The new run uses the old JSON to evaluate whether the answer is unchanged since the old run. If so, it reuses that information, avoiding a costly 'git fetch', and sets a new Reuse: true field in its own JSON output. This dance with saving the JSON output and passing it back to -reuse is not necessary on most systems, because the go command caches version control checkouts in the module cache. That cache means that a new 'git fetch' would only download the commits that are new since the previous one (often none at all). The dance becomes important only on systems that do not preserve the module cache, for example by running 'go clean -modcache' aggressively or by running in some environment that starts with an empty file system. For #53644. Change-Id: I447960abf8055f83cc6dbc699a9fde9931130004 Reviewed-on: https://go-review.googlesource.com/c/go/+/411398 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/os/exec/exec.go')
0 files changed, 0 insertions, 0 deletions