migrate away from deprecated ioutil APIs (#7175)

Co-authored-by: Callum Waters <cmwaters19@gmail.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This commit is contained in:
Sharad Chand
2021-10-28 10:34:07 -07:00
committed by GitHub
co-authored by Callum Waters M. J. Fromberger
parent 6108d0a9b5
commit 8441b3715a
58 changed files with 158 additions and 192 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
package server_test
import (
"io/ioutil"
"io"
"os"
"path/filepath"
"testing"
@@ -25,7 +25,7 @@ func TestServerTestdataCases(t *testing.T) {
}()
f, err := os.Open(filepath.Join(testdataCasesDir, entry.Name()))
require.NoError(t, err)
input, err := ioutil.ReadAll(f)
input, err := io.ReadAll(f)
require.NoError(t, err)
server.Fuzz(input)
})
+3 -3
View File
@@ -3,13 +3,13 @@ package server
import (
"bytes"
"encoding/json"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"github.com/tendermint/tendermint/libs/log"
rs "github.com/tendermint/tendermint/rpc/jsonrpc/server"
types "github.com/tendermint/tendermint/rpc/jsonrpc/types"
"github.com/tendermint/tendermint/rpc/jsonrpc/types"
)
var rpcFuncMap = map[string]*rs.RPCFunc{
@@ -32,7 +32,7 @@ func Fuzz(data []byte) int {
rec := httptest.NewRecorder()
mux.ServeHTTP(rec, req)
res := rec.Result()
blob, err := ioutil.ReadAll(res.Body)
blob, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}