Skip to content

Commit

Permalink
refactor: remove deprecated ioutil.ReadAll in favour of io.ReadAll
Browse files Browse the repository at this point in the history
  • Loading branch information
tommytroen committed Aug 23, 2023
1 parent 26eebf6 commit 04c2c5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/tokendings/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"

Expand Down Expand Up @@ -64,7 +64,7 @@ func DeleteClient(ctx context.Context, accessToken string, tokenDingsUrl string,
return nil
}

msg, _ := ioutil.ReadAll(resp.Body)
msg, _ := io.ReadAll(resp.Body)

return fmt.Errorf("delete client from tokendings: %s: %s", resp.Status, msg)
}
Expand Down Expand Up @@ -119,7 +119,7 @@ func RegisterClient(cr ClientRegistration, accessToken string, tokenDingsUrl str

defer resp.Body.Close()
if resp.StatusCode != http.StatusCreated {
response, _ := ioutil.ReadAll(resp.Body)
response, _ := io.ReadAll(resp.Body)
return fmt.Errorf("unable to register application with tokendings: %s: %s", resp.Status, response)
}

Expand Down

0 comments on commit 04c2c5a

Please sign in to comment.