1
0
mirror of https://github.com/golang/go synced 2024-11-26 12:09:04 -07:00
The Go programming language
Go to file
Michael Matloob 4dd9c7cadc cmd/go: remove some fsyncs when writing files
cache.Trim, dowloadZip, rewriteVersionList, writeDiskCache all use
renameio.WriteFile to write their respective files to disk. For the
uses in cache.Trim and downloadZip, instead do of renameio.WriteFile,
do a truncate to the length of the file, then write the relevant bytes
so that a corrupt file (which would contain null bytes because of
the truncate) could be detected. For rewriteVersionList, use
lockedfile.Transform to do the write (which does a truncate as part of
the write too. writeDiskCache stays the same in this CL.

Also desete renameio methods that aren't used and remove the
renameio.WriteFile wrapper and just use renameio.WriteToFile which it
wraps.

There is a possibility of corrupt files in the cache (which was true
even before this CL) so later CLs will add facilities to clear corrupt
files in the cache.

Change-Id: I0d0bda40095e4cb898314315bf313e71650d8d25
Reviewed-on: https://go-review.googlesource.com/c/go/+/277412
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-03-11 20:01:00 +00:00
.github
api
doc
lib/time
misc cmd/dist: refactor test constraints for misc/cgo/testsantizers 2021-03-11 05:38:13 +00:00
src cmd/go: remove some fsyncs when writing files 2021-03-11 20:01:00 +00:00
test cmd/compile: optimize multi-register shifts on amd64 2021-03-11 19:11:46 +00:00
.gitattributes
.gitignore
AUTHORS A+C: change email address for Baokun Lee 2021-03-03 02:31:34 +00:00
codereview.cfg
CONTRIBUTING.md
CONTRIBUTORS A+C: change email address for Baokun Lee 2021-03-03 02:31:34 +00:00
favicon.ico
LICENSE
PATENTS
README.md
robots.txt
SECURITY.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image 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.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at 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.