Skip to content

Commit

Permalink
Use io.ReadAll instead of ioutil.ReadAll
Browse files Browse the repository at this point in the history
  • Loading branch information
printesoi committed Dec 15, 2024
1 parent 9a6fe01 commit 5afe025
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/oauth2/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"math"
"mime"
"net/http"
Expand Down Expand Up @@ -257,7 +256,7 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) {
if err != nil {
return nil, err
}
body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20))
body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20))
r.Body.Close()
if err != nil {
return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err)
Expand Down

0 comments on commit 5afe025

Please sign in to comment.