]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modindex: don't write index entry if file open
authorMichael Matloob <matloob@golang.org>
Mon, 6 Jan 2025 16:10:02 +0000 (11:10 -0500)
committerMichael Matloob <matloob@golang.org>
Tue, 7 Jan 2025 20:50:01 +0000 (12:50 -0800)
commitb50ccef67a5cd4a2919131cfeb6f3a21d6742385
tree995f0dd8ac0dbf9034cd0d1fe5b0b4c6eef15262
parentb2aa18b96cefb48641ec69a79bc67d030b93f093
cmd/go/internal/modindex: don't write index entry if file open

On Windows, we can't open a file that's already been opened. Before this
change, we'd try to write an index entry if mmapping the entry failed.
But that could happen either if the file doesn't exist or if there was a
problem mmapping an already opened file. Pass through information about
whether the file was actually opened so that we don't try to write to an
already opened file.

For #71059

Change-Id: I6adabe1093fed9ec37e7fafb13384c102786cbce
Reviewed-on: https://go-review.googlesource.com/c/go/+/640577
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/cache/cache.go
src/cmd/go/internal/mmap/mmap.go
src/cmd/go/internal/modindex/read.go