refactor: stop using deprecated io/ioutil
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -147,7 +146,7 @@ func APISecret(keystore types.KeyStore, lr repo.LockedRepo) (*dtypes.APIAlg, err
|
||||
if errors.Is(err, types.ErrKeyInfoNotFound) {
|
||||
log.Warn("Generating new API secret")
|
||||
|
||||
sk, err := ioutil.ReadAll(io.LimitReader(rand.Reader, 32))
|
||||
sk, err := io.ReadAll(io.LimitReader(rand.Reader, 32))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/ipfs/go-blockservice"
|
||||
@@ -60,7 +59,7 @@ func MakeGenesis(outFile, genesisTemplate string) func(bs dtypes.ChainBlockstore
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fdata, err := ioutil.ReadFile(genesisTemplate)
|
||||
fdata, err := os.ReadFile(genesisTemplate)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("reading preseals json: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user