Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/peggo/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"bytes"
"encoding/hex"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
Expand All @@ -18,7 +17,7 @@ import (
// readEnv is a special utility that reads `.env` file into actual environment variables
// of the current app, similar to `dotenv` Node package.
func readEnv() {
if envdata, _ := ioutil.ReadFile(".env"); len(envdata) > 0 {
if envdata, _ := os.ReadFile(".env"); len(envdata) > 0 {
s := bufio.NewScanner(bytes.NewReader(envdata))
for s.Scan() {
parts := strings.Split(s.Text(), "=")
Expand Down
4 changes: 2 additions & 2 deletions peggo/orchestrator/ethereum/keystore/keycache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package keystore
import (
"crypto/ecdsa"
"crypto/sha1"
"io/ioutil"
"math/big"
"os"
"strings"
"sync"

Expand Down Expand Up @@ -87,7 +87,7 @@ func (k *keyCache) PrivateKey(account common.Address, password string) (*ecdsa.P
path = strings.TrimPrefix(path, "keystore://")
}

keyJSON, err := ioutil.ReadFile(path)
keyJSON, err := os.ReadFile(path)
if err != nil {
err = errors.Wrap(err, "failed to load a file from keystore")
return nil, err
Expand Down
3 changes: 1 addition & 2 deletions peggo/orchestrator/ethereum/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
Expand Down Expand Up @@ -98,7 +97,7 @@ func (ks *keyStore) forEachWallet(keystorePath string, fn func(spec *WalletSpec)
return filepath.SkipDir
}
var spec *WalletSpec
if data, err := ioutil.ReadFile(path); err != nil {
if data, err := os.ReadFile(path); err != nil {
return err
} else if err = json.Unmarshal(data, &spec); err != nil {
return err
Expand Down
3 changes: 1 addition & 2 deletions peggo/orchestrator/pricefeed/coingecko.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pricefeed
import (
"encoding/json"
"io"
"io/ioutil"
"net/http"
"net/url"
"path"
Expand Down Expand Up @@ -104,7 +103,7 @@ func (cp *CoingeckoPriceFeed) QueryUSDPrice(erc20Contract common.Address) (float
return zeroPrice, errors.Wrapf(err, "failed to fetch price from %s", reqURL)
}

respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, maxRespBytes))
respBody, err := io.ReadAll(io.LimitReader(resp.Body, maxRespBytes))
if err != nil {
_ = resp.Body.Close()
metrics.ReportFuncError(cp.svcTags)
Expand Down
3 changes: 1 addition & 2 deletions peggo/test/peggo/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bufio"
"bytes"
"crypto/ecdsa"
"io/ioutil"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -88,7 +87,7 @@ func init() {
// readEnv is a special utility that reads `.env` file into actual environment variables
// of the current app, similar to `dotenv` Node package.
func readEnv() {
if envdata, _ := ioutil.ReadFile(".env"); len(envdata) > 0 {
if envdata, _ := os.ReadFile(".env"); len(envdata) > 0 {
s := bufio.NewScanner(bytes.NewReader(envdata))
for s.Scan() {
parts := strings.Split(s.Text(), "=")
Expand Down