]> Cypherpunks repositories - gostls13.git/commit
cmd/go: reset modfetch state between modules in go work sync
authorMichael Matloob <matloob@golang.org>
Fri, 7 Jan 2022 21:52:53 +0000 (16:52 -0500)
committerMichael Matloob <matloob@golang.org>
Thu, 13 Jan 2022 19:25:50 +0000 (19:25 +0000)
commitce01afe907f7f37b465bda529a339a7a8b98c59e
treead08ae7d3113de0e5b643e562387abf2f39615b4
parent4fa6e33f30365a8bca374ab8bd47acd82b9faa96
cmd/go: reset modfetch state between modules in go work sync

go work sync resets the state in the modload package before each
iteration where it updates the workspace modules' go.mod files. But
before this change it wasn't resetting the global state in the modfetch
package. This is necessary because the modfetch package keeps track of
the sums that will be written to go.sum. Further, the fetch caches
will update information about which modules are used when fetching
packages, and so those caches need to be cleared between each workspace
module.

Thanks bcmills for helping me debug!

Fixes #50038

Change-Id: I5679c18a80feb7c5194c4a5f7e7129c7d198ef7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/376655
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/workcmd/sync.go
src/cmd/go/testdata/script/work_sync_sum.txt [new file with mode: 0644]