mirror of
https://github.com/restic/restic.git
synced 2026-10-07 19:07:12 +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
@@ -3,7 +3,6 @@ package debug
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"os"
|
||||
@@ -30,7 +29,7 @@ func (rd *eofDetectReader) Read(p []byte) (n int, err error) {
|
||||
|
||||
func (rd *eofDetectReader) Close() error {
|
||||
if !rd.eofSeen {
|
||||
buf, err := ioutil.ReadAll(rd)
|
||||
buf, err := io.ReadAll(rd)
|
||||
msg := fmt.Sprintf("body not drained, %d bytes not read", len(buf))
|
||||
if err != nil {
|
||||
msg += fmt.Sprintf(", error: %v", err)
|
||||
|
||||
Reference in new issue
Block a user