Skip to content

Commit

Permalink
Paid functions workaround removed
Browse files Browse the repository at this point in the history
  • Loading branch information
dimuska139 committed Jan 8, 2021
1 parent 15109c8 commit c7149b6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"golang.org/x/time/rate"
"io/ioutil"
"net/http"
"regexp"
)

const apiBaseUrl = "https://api.rawg.io/api"
Expand Down Expand Up @@ -66,14 +65,7 @@ func (api *Client) get(path string, params map[string]interface{}, responseModel
req.Header.Add("content-type", "application/json;charset=utf-8")
q := req.URL.Query()

// Workaround to switch to using API key (not all methods of the RAWG API support it)
suggestedURLr, _ := regexp.Compile("/games/[0-9+]/suggested")
twitchURLr, _ := regexp.Compile("/games/[0-9+]/twitch")
youtubeURLr, _ := regexp.Compile("/games/[0-9+]/youtube")
if !suggestedURLr.MatchString(path) && !twitchURLr.MatchString(path) && !youtubeURLr.MatchString(path) {
q.Add("key", api.config.ApiKey)
}
//////////////////////////////////////////////////////////////////////////////////////
q.Add("key", api.config.ApiKey)

q.Add("lang", api.config.Language)
for param, value := range params {
Expand Down

0 comments on commit c7149b6

Please sign in to comment.