mirror of
https://github.com/restic/restic.git
synced 2025-08-11 10:07:47 +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:
@@ -6,7 +6,6 @@ import (
|
||||
"encoding/base64"
|
||||
"hash"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"sync"
|
||||
|
||||
"github.com/cespare/xxhash/v2"
|
||||
@@ -96,7 +95,7 @@ func (be *MemoryBackend) Save(ctx context.Context, h restic.Handle, rd restic.Re
|
||||
return errors.New("file already exists")
|
||||
}
|
||||
|
||||
buf, err := ioutil.ReadAll(rd)
|
||||
buf, err := io.ReadAll(rd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -168,7 +167,7 @@ func (be *MemoryBackend) openReader(ctx context.Context, h restic.Handle, length
|
||||
buf = buf[:length]
|
||||
}
|
||||
|
||||
return be.sem.ReleaseTokenOnClose(ioutil.NopCloser(bytes.NewReader(buf)), nil), ctx.Err()
|
||||
return be.sem.ReleaseTokenOnClose(io.NopCloser(bytes.NewReader(buf)), nil), ctx.Err()
|
||||
}
|
||||
|
||||
// Stat returns information about a file in the backend.
|
||||
|
Reference in New Issue
Block a user