Skip to content

Commit 363f259

Browse files
committed
[release-branch.go1.21] cmd/go: make go list -m -u all not complain about missing checksums
This is a band-aid of a fix for Go 1.21, to create space to work on a real fix for Go 1.22, if in fact the real fix is different. It simply disables the go.sum update check during go list -m -u. I don't have a self-contained test for the breakage. See #61605. All existing tests continue to pass. For #61605. After merging into the Go 1.21 branch we can move #61605 to the Go 1.22 milestone. Change-Id: Ib155710092003f08d2a6ce0aefa8e0270cad5a5c Reviewed-on: https://go-review.googlesource.com/c/go/+/514899 Reviewed-by: Michael Matloob <[email protected]> Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 9b53b9b commit 363f259

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/cmd/go/internal/modload/list.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ func ListModules(ctx context.Context, args []string, mode ListMode, reuseFile st
110110

111111
if err == nil {
112112
requirements = rs
113-
if !ExplicitWriteGoMod {
113+
// TODO(#61605): The extra ListU clause fixes a problem with Go 1.21rc3
114+
// where "go mod tidy" and "go list -m -u all" fight over whether the go.sum
115+
// should be considered up-to-date. The fix for now is to always treat the
116+
// go.sum as up-to-date during list -m -u. Probably the right fix is more targeted,
117+
// but in general list -u is looking up other checksums in the checksum database
118+
// that won't be necessary later, so it makes sense not to write the go.sum back out.
119+
if !ExplicitWriteGoMod && mode&ListU == 0 {
114120
err = commitRequirements(ctx, WriteOpts{})
115121
}
116122
}

0 commit comments

Comments
 (0)