linter appeasement for 1.19

This commit is contained in:
Michael Shaw 2023-03-16 19:05:32 -04:00
parent f479ec7bf8
commit 812f88a56f
7 changed files with 15 additions and 20 deletions

View File

@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
check-latest: true
- uses: actions/checkout@v2
- name: Run linter

View File

@ -3,7 +3,7 @@ package ipld
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"os"
"runtime"
"strconv"
@ -495,7 +495,7 @@ func prepareStoredEthBlock(filepath string, t *testing.T) *block.BasicBlock {
fi, err := os.Open(filepath)
checkError(err, t)
b, err := ioutil.ReadAll(fi)
b, err := io.ReadAll(fi)
checkError(err, t)
c, err := RawdataToCid(MEthHeader, b, multihash.KECCAK_256)

View File

@ -21,15 +21,13 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"github.com/ipfs/go-cid"
node "github.com/ipfs/go-ipld-format"
"github.com/multiformats/go-multihash"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ipfs/go-cid"
node "github.com/ipfs/go-ipld-format"
"github.com/multiformats/go-multihash"
)
// FromBlockRLP takes an RLP message representing
@ -37,7 +35,7 @@ import (
// to return it as a set of IPLD nodes for further processing.
func FromBlockRLP(r io.Reader) (*EthHeader, []*EthTx, []*EthTxTrie, error) {
// We may want to use this stream several times
rawdata, err := ioutil.ReadAll(r)
rawdata, err := io.ReadAll(r)
if err != nil {
return nil, nil, nil, err
}

View File

@ -17,7 +17,7 @@
package ipld
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
@ -63,7 +63,7 @@ func loadBlockData(t *testing.T) []testCase {
fileDir := "./eip2930_test_data"
testCases := make([]testCase, len(blockFileNames))
for i, blockFileName := range blockFileNames {
blockRLP, err := ioutil.ReadFile(filepath.Join(fileDir, blockFileName))
blockRLP, err := os.ReadFile(filepath.Join(fileDir, blockFileName))
if err != nil {
t.Fatalf("failed to load blockRLP from file, err %v", err)
}
@ -72,7 +72,7 @@ func loadBlockData(t *testing.T) []testCase {
t.Fatalf("failed to decode blockRLP, err %v", err)
}
receiptsFileName := receiptsFileNames[i]
receiptsRLP, err := ioutil.ReadFile(filepath.Join(fileDir, receiptsFileName))
receiptsRLP, err := os.ReadFile(filepath.Join(fileDir, receiptsFileName))
if err != nil {
t.Fatalf("failed to load receiptsRLP from file, err %s", err)
}

View File

@ -19,13 +19,11 @@ package ipld
import (
"fmt"
"io"
"io/ioutil"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ipfs/go-cid"
node "github.com/ipfs/go-ipld-format"
"github.com/multiformats/go-multihash"
"github.com/ethereum/go-ethereum/rlp"
)
// EthStateTrie (eth-state-trie, codec 0x96), represents
@ -44,7 +42,7 @@ var _ node.Node = (*EthStateTrie)(nil)
// FromStateTrieRLPFile takes the RLP representation of an ethereum
// state trie node to return it as an IPLD node for further processing.
func FromStateTrieRLPFile(r io.Reader) (*EthStateTrie, error) {
raw, err := ioutil.ReadAll(r)
raw, err := io.ReadAll(r)
if err != nil {
return nil, err
}

View File

@ -19,7 +19,6 @@ package ipld
import (
"fmt"
"io"
"io/ioutil"
"github.com/ipfs/go-cid"
node "github.com/ipfs/go-ipld-format"
@ -42,7 +41,7 @@ var _ node.Node = (*EthStorageTrie)(nil)
// FromStorageTrieRLPFile takes the RLP representation of an ethereum
// storage trie node to return it as an IPLD node for further processing.
func FromStorageTrieRLPFile(r io.Reader) (*EthStorageTrie, error) {
raw, err := ioutil.ReadAll(r)
raw, err := io.ReadAll(r)
if err != nil {
return nil, err
}

View File

@ -19,7 +19,7 @@ package statediff_test
import (
"bytes"
"fmt"
"io/ioutil"
"io"
"log"
"math/big"
"os"
@ -457,7 +457,7 @@ func loadBlockFromRLPFile(filename string) (*types.Block, []byte, error) {
return nil, nil, err
}
defer f.Close()
blockRLP, err := ioutil.ReadAll(f)
blockRLP, err := io.ReadAll(f)
if err != nil {
return nil, nil, err
}