mirror of
https://github.com/restic/restic.git
synced 2026-10-13 05:27:13 +00:00
Replace most usages of ioutil with the underlying function
The ioutil functions are deprecated since Go 1.17 and only wrap another library function. Thus directly call the underlying function. This commit only mechanically replaces the function calls.
This commit is contained in:
1 parent
2d5e28e777
commit
ff7ef5007e
57 files changed
+119
-159
No files matched your search
@@ -2,7 +2,6 @@ package archiver
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@@ -73,7 +72,7 @@ func TestCreateFiles(t testing.TB, target string, dir TestDir) {
|
||||
|
||||
switch it := item.(type) {
|
||||
case TestFile:
|
||||
err := ioutil.WriteFile(targetPath, []byte(it.Content), 0644)
|
||||
err := os.WriteFile(targetPath, []byte(it.Content), 0644)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -152,7 +151,7 @@ func TestEnsureFiles(t testing.TB, target string, dir TestDir) {
|
||||
return nil
|
||||
}
|
||||
|
||||
content, err := ioutil.ReadFile(path)
|
||||
content, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user