Skip to content

Commit

Permalink
chore: replace ioutil.readall with io.readall
Browse files Browse the repository at this point in the history
  • Loading branch information
ddlees committed Sep 1, 2023
1 parent 5dc2e38 commit 32c61fe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions client/rest/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"encoding/pem"
"fmt"
"io"
"io/ioutil"
"strings"
"time"

Expand All @@ -36,7 +35,7 @@ import (

func Decode(body io.ReadCloser, v interface{}) error {
defer body.Close()
defer ioutil.ReadAll(body)
defer io.ReadAll(body) // must read all; streaming to the json decoder does not read to EOF making the connection unavailable for reuse
return json.NewDecoder(body).Decode(v)
}

Expand Down

0 comments on commit 32c61fe

Please sign in to comment.