diff --git a/internal/apis/applemusic/api.go b/internal/apis/applemusic/api.go index e75d912..714cd2d 100644 --- a/internal/apis/applemusic/api.go +++ b/internal/apis/applemusic/api.go @@ -14,7 +14,7 @@ import ( func sendAppleMusicAPIRequest[T any](path string) (T, error) { var zeroValue T req, err := http.NewRequest( - "GET", + http.MethodGet, fmt.Sprintf("https://api.music.apple.com/%s", strings.TrimLeft(path, "/")), nil, ) diff --git a/internal/apis/steam/achievements.go b/internal/apis/steam/achievements.go index 251233b..0507ae1 100644 --- a/internal/apis/steam/achievements.go +++ b/internal/apis/steam/achievements.go @@ -106,7 +106,7 @@ func fetchGameAchievements(appID int32) (*float32, *[]achievement, error) { "format": {"json"}, } req, err := http.NewRequest( - "GET", + http.MethodGet, "https://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2?"+params.Encode(), nil, ) diff --git a/internal/apis/strava/api.go b/internal/apis/strava/api.go index 4e8b09c..b809b58 100644 --- a/internal/apis/strava/api.go +++ b/internal/apis/strava/api.go @@ -14,7 +14,7 @@ func sendStravaAPIRequest[T any](path string, tokens tokens) (T, error) { var zeroValue T req, err := http.NewRequest( - "GET", + http.MethodGet, fmt.Sprintf("https://www.strava.com/%s", strings.TrimLeft(path, "/")), nil, ) diff --git a/internal/apis/strava/tokens.go b/internal/apis/strava/tokens.go index 947684e..1201bd5 100644 --- a/internal/apis/strava/tokens.go +++ b/internal/apis/strava/tokens.go @@ -38,7 +38,11 @@ func (t *tokens) refreshIfNeeded() { "refresh_token": {t.Refresh}, "code": {secrets.SECRETS.StravaOAuthCode}, } - req, err := http.NewRequest("POST", "https://www.strava.com/oauth/token?"+params.Encode(), nil) + req, err := http.NewRequest( + http.MethodPost, + "https://www.strava.com/oauth/token?"+params.Encode(), + nil, + ) if err != nil { lumber.Error(err, "creating request for new token failed") return