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:
Michael Eischer committed 2022-12-02 19:36:43 +01:00
1 parent 2d5e28e777
commit ff7ef5007e
57 files changed
+119 -159

No files matched your search

+1 -2
View File
@@ -6,7 +6,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"runtime"
"sort"
"sync"
@@ -556,7 +555,7 @@ func checkPack(ctx context.Context, r restic.Repository, id restic.ID, blobs []r
}
// read remainder, which should be the pack header
hdrBuf, err = ioutil.ReadAll(bufRd)
hdrBuf, err = io.ReadAll(bufRd)
if err != nil {
return err
}
+1 -2
View File
@@ -3,7 +3,6 @@ package checker_test
import (
"context"
"io"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
@@ -208,7 +207,7 @@ func TestModifiedIndex(t *testing.T) {
Name: "90f838b4ac28735fda8644fe6a08dbc742e57aaf81b30977b4fefa357010eafd",
}
tmpfile, err := ioutil.TempFile("", "restic-test-mod-index-")
tmpfile, err := os.CreateTemp("", "restic-test-mod-index-")
if err != nil {
t.Fatal(err)
}