internal/legacy: deprecate io/ioutil (#352)

Signed-off-by: jay-dee7 <me@jsdp.dev>
This commit is contained in:
Jasdeep Singh 2023-09-08 15:30:49 +05:30 committed by GitHub
parent dd85371fa2
commit e5a617e450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"reflect"
@ -1958,7 +1957,7 @@ func ReadState(src io.Reader) (*State, error) {
// If we are JSON we buffer the whole thing in memory so we can read it twice.
// This is suboptimal, but will work for now.
jsonBytes, err := ioutil.ReadAll(buf)
jsonBytes, err := io.ReadAll(buf)
if err != nil {
return nil, fmt.Errorf("Reading state file failed: %v", err)
}