Skip to content

Commit

Permalink
remove deprecated ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
idanya committed Jul 16, 2023
1 parent 0d0c715 commit fd3721d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions clients/directory/openchain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package openchain
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
)
Expand Down Expand Up @@ -37,7 +37,7 @@ func (c *Client) lookupEntity(entityType EntityType, hash string) (string, error

defer resp.Body.Close()

data, err := ioutil.ReadAll(resp.Body)
data, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/editor.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package cmd

import (
"io/ioutil"
"log"
"os"
"os/exec"
)

func openInEditor(text []byte) error {
tmpFile, err := ioutil.TempFile(os.TempDir(), "evm-cli-")
tmpFile, err := os.CreateTemp(os.TempDir(), "evm-cli-")
if err != nil {
log.Fatal("Cannot create temporary file", err)
}
Expand Down
4 changes: 2 additions & 2 deletions services/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package services
import (
"context"
"errors"
"io/ioutil"
"math/big"
"os"
"testing"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -73,7 +73,7 @@ func TestExecuteReadFunction(t *testing.T) {
}

func TestGetContractStandards(t *testing.T) {
file, _ := ioutil.ReadFile("../assets/FiatTokenV2.hex")
file, _ := os.ReadFile("../assets/FiatTokenV2.hex")
erc20Code := common.Hex2Bytes(string(file))

directoryClientMock := dirmock.NewDirectoryClient(t)
Expand Down

0 comments on commit fd3721d

Please sign in to comment.