Skip to content

Commit

Permalink
fix: remove ioutil lib and unneeded log statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Huck committed Dec 12, 2023
1 parent a99961c commit 5c27e68
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/adapter/outlook_http/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
Expand Down Expand Up @@ -82,7 +82,6 @@ func (c *CalendarAPI) SetupOauth2(credentials auth.Credentials, storage auth.Sto
return err
}
if storedAuth != nil {
log.Debugf("stored access token expires on: %s", storedAuth.OAuth2.Expiry)
expiry, err := time.Parse(time.RFC3339, storedAuth.OAuth2.Expiry)
if err != nil {
return err
Expand Down Expand Up @@ -258,7 +257,7 @@ func getNewRefreshToken(currentRefreshToken string, clientID string, tokenUrl st
data.Set("refresh_token", currentRefreshToken)
data.Set("client_id", clientID)

req, err := http.NewRequest("POST", tokenUrl, ioutil.NopCloser(strings.NewReader(data.Encode())))
req, err := http.NewRequest("POST", tokenUrl, strings.NewReader(data.Encode()))
if err != nil {
return a, err
}
Expand All @@ -272,7 +271,7 @@ func getNewRefreshToken(currentRefreshToken string, clientID string, tokenUrl st
return a, err
}

respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return a, err
}
Expand Down

0 comments on commit 5c27e68

Please sign in to comment.