dev: replace ioutil with io and os (#2318)

This commit is contained in:
Benjamin 2021-11-02 03:21:26 +08:00 committed by GitHub
parent e612577dfc
commit e5cd59a607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 40 additions and 51 deletions

View file

@ -24,7 +24,7 @@ func Pattern(filename string) string {
return filepath.Join(filepath.Dir(filename), filepath.Base(filename)+patternSuffix)
}
// WriteFile is like ioutil.WriteFile, but first writes data to an arbitrary
// WriteFile is like os.WriteFile, but first writes data to an arbitrary
// file in the same directory as filename, then renames it atomically to the
// final name.
//
@ -79,7 +79,7 @@ func tempFile(dir, prefix string, perm os.FileMode) (f *os.File, err error) {
return
}
// ReadFile is like ioutil.ReadFile, but on Windows retries spurious errors that
// ReadFile is like os.ReadFile, but on Windows retries spurious errors that
// may occur if the file is concurrently replaced.
//
// Errors are classified heuristically and retries are bounded, so even this