[#1250] *: Remove io/ioutil imports

It is deprecated starting from go1.16.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-18 14:12:58 +03:00 committed by Alex Vanin
parent 3bdab77c42
commit 622ea4818f
9 changed files with 28 additions and 32 deletions

View file

@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"sort"
"github.com/nspcc-dev/neo-go/pkg/crypto/hash"
@ -112,7 +112,7 @@ func dumpContainers(cmd *cobra.Command, _ []string) error {
if err != nil {
return err
}
return ioutil.WriteFile(filename, out, 0o660)
return os.WriteFile(filename, out, 0o660)
}
func restoreContainers(cmd *cobra.Command, _ []string) error {
@ -136,7 +136,7 @@ func restoreContainers(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("can't fetch container contract hash: %w", err)
}
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err != nil {
return fmt.Errorf("can't read dump file: %w", err)
}