Skip to content

Commit

Permalink
chore: remove ioutil usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Jul 7, 2023
1 parent f62bab3 commit 6896f05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions cmd/tui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -92,13 +91,13 @@ func getRequestorOrExit(algodDataDir, url, token string) *messages.Requestor {
tokenpath := filepath.Join(algodDataDir, "algod.token")

var netaddrbytes []byte
netaddrbytes, err := ioutil.ReadFile(netpath)
netaddrbytes, err := os.ReadFile(netpath)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to read URL from file (%s): %s\n", netpath, err.Error())
os.Exit(1)
}
url = strings.TrimSpace(string(netaddrbytes))
tokenBytes, err := ioutil.ReadFile(tokenpath)
tokenBytes, err := os.ReadFile(tokenpath)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to read Token from file (%s): %s\n", tokenpath, err.Error())
os.Exit(1)
Expand Down
4 changes: 2 additions & 2 deletions messages/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package messages
import (
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"path"
Expand Down Expand Up @@ -146,7 +146,7 @@ func doFastCatchupRequest(verb, network string) error {
if err != nil {
panic(err)
}
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 6896f05

Please sign in to comment.