Skip to content

Commit e8ed85d

Browse files
committed
cmd/go: update goSum if necessary
During investigation into #74691, we found a case where the hash was missing from the goSum global var. This change updates DownloadZip to update the goSum hash if necessary when both the zipfile and ziphashfile are already present. For #74691 Change-Id: I904b7265f667256d0c60b66503a7954b467c6454 Reviewed-on: https://go-review.googlesource.com/c/go/+/705215 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Matloob <matloob@google.com>
1 parent b76103c commit e8ed85d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cmd/go/internal/modfetch/fetch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,12 @@ func DownloadZip(ctx context.Context, mod module.Version) (zipfile string, err e
214214
}
215215
ziphashfile := zipfile + "hash"
216216

217-
// Return without locking if the zip and ziphash files exist.
217+
// Return early if the zip and ziphash files exist.
218218
if _, err := os.Stat(zipfile); err == nil {
219219
if _, err := os.Stat(ziphashfile); err == nil {
220+
if !HaveSum(mod) {
221+
checkMod(ctx, mod)
222+
}
220223
return zipfile, nil
221224
}
222225
}

0 commit comments

Comments
 (0)