refactor: move from io/ioutil to io and os packages (#5266)
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. [1]: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -19,7 +19,6 @@ package fake
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/service/s3"
|
||||
@@ -66,7 +65,7 @@ func (s *FakeS3) Delete(key string) error {
|
||||
|
||||
func (s *FakeS3) Read(key string) ([]byte, error) {
|
||||
if o, ok := s.Storage[key]; ok && o.Body != nil {
|
||||
data, err := ioutil.ReadAll(o.Body)
|
||||
data, err := io.ReadAll(o.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user