From 984ead2896698dea0bc37cad5329397737a62a22 Mon Sep 17 00:00:00 2001 From: Ethan Lowman Date: Wed, 24 Aug 2022 15:53:00 -0400 Subject: [PATCH] Remove one more ioutil instance Signed-off-by: Ethan Lowman --- client/client.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/client.go b/client/client.go index 5b7fa41ee..0f025c5fe 100644 --- a/client/client.go +++ b/client/client.go @@ -5,7 +5,6 @@ import ( "encoding/hex" "encoding/json" "io" - "io/ioutil" "github.com/theupdateframework/go-tuf/data" "github.com/theupdateframework/go-tuf/util" @@ -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 @@ -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) {