Skip to content

Commit

Permalink
Remove one more ioutil instance
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Lowman <[email protected]>
  • Loading branch information
ethan-lowman-dd committed Aug 24, 2022
1 parent e7fa8c3 commit 984ead2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/hex"
"encoding/json"
"io"
"io/ioutil"

"github.com/theupdateframework/go-tuf/data"
"github.com/theupdateframework/go-tuf/util"
Expand Down Expand Up @@ -551,7 +550,7 @@ func (c *Client) downloadMetaUnsafe(name string, maxMetaSize int64) ([]byte, err
// although the size has been checked above, use a LimitReader in case
// the reported size is inaccurate, or size is -1 which indicates an
// unknown length
return ioutil.ReadAll(io.LimitReader(r, maxMetaSize))
return io.ReadAll(io.LimitReader(r, maxMetaSize))
}

// remoteGetFunc is the type of function the download method uses to download
Expand Down Expand Up @@ -622,7 +621,7 @@ func (c *Client) downloadMeta(name string, version int64, m data.FileMeta) ([]by
stream = r
}

return ioutil.ReadAll(stream)
return io.ReadAll(stream)
}

func (c *Client) downloadMetaFromSnapshot(name string, m data.SnapshotFileMeta) ([]byte, error) {
Expand Down

0 comments on commit 984ead2

Please sign in to comment.