commit | 2fc7574aab072c697d2d020fa48347b0c1b221e7 | [log] [tgz] |
---|---|---|
author | Bryan C. Mills <bcmills@google.com> | Thu Jul 25 20:26:46 2019 -0400 |
committer | Bryan C. Mills <bcmills@google.com> | Tue Jul 30 20:16:40 2019 +0000 |
tree | 8772768cd62effdf47a16c42e2efde4a2c841fec | |
parent | 8c3040d768e70fd6cf9f992fe4745edbf51bc581 [diff] |
cmd/go/internal/cache: avoid ioutil.WriteFile for writing cache entries ioutil.WriteFile always truncates the destination file to 0 before writing, which is inappropriate for unsynchronized, idempotent, fixed-size files such as the cache entry files here. Instead, truncate the file only after writing it, so that a second write will never (even temporarily!) remove the contents of a preceding write. Fixes #29667 Change-Id: I16a53ce79d8a23d23580511cb6abd062f54b65ef Reviewed-on: https://go-review.googlesource.com/c/go/+/188157 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.