forked from TrueCloudLab/frostfs-node
[#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:
parent
3bdab77c42
commit
622ea4818f
9 changed files with 28 additions and 32 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
|
@ -123,7 +122,7 @@ func createEACL(cmd *cobra.Command, _ []string) {
|
|||
return
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(outArg, buf.Bytes(), 0644)
|
||||
err = os.WriteFile(outArg, buf.Bytes(), 0644)
|
||||
if err != nil {
|
||||
cmd.PrintErrln(err)
|
||||
os.Exit(1)
|
||||
|
@ -135,7 +134,7 @@ func getRulesFromFile(filename string) ([]string, error) {
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadFile(filename)
|
||||
data, err := os.ReadFile(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package cmd
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
@ -39,7 +39,7 @@ func Test_getKey(t *testing.T) {
|
|||
keyPath := filepath.Join(dir, "binary.key")
|
||||
rawKey, err := keys.NewPrivateKey()
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, ioutil.WriteFile(keyPath, rawKey.Bytes(), os.ModePerm))
|
||||
require.NoError(t, os.WriteFile(keyPath, rawKey.Bytes(), os.ModePerm))
|
||||
|
||||
wifKey, err := keys.NewPrivateKey()
|
||||
require.NoError(t, err)
|
||||
|
@ -52,7 +52,7 @@ func Test_getKey(t *testing.T) {
|
|||
in := bytes.NewBuffer(nil)
|
||||
input.Terminal = term.NewTerminal(input.ReadWriter{
|
||||
Reader: in,
|
||||
Writer: ioutil.Discard,
|
||||
Writer: io.Discard,
|
||||
}, "")
|
||||
|
||||
checkKeyError(t, filepath.Join(dir, "badfile"), errInvalidKey)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue