Skip to content

Commit

Permalink
rename json variable
Browse files Browse the repository at this point in the history
  • Loading branch information
surskitt committed Jan 16, 2020
1 parent 67c074e commit eb3556e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/trakt/trakt.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ func trakt(command *bot.Cmd) (msg string, err error) {
args := url.QueryEscape(command.RawArgs)
url := fmt.Sprintf(trakt_api_url, args)

data := &traktJson{}
j := &traktJson{}
headers := map[string]string{
"Content-Type": "application/json",
"trakt-api-version": "2",
"trakt-api-key": api_key,
}
err = web.GetJSONWithHeaders(url, headers, data)
err = web.GetJSONWithHeaders(url, headers, j)

if err != nil {
return "", err
}

out := fmt.Sprintf("%s last watched: %s", args, data.Latest())
out := fmt.Sprintf("%s last watched: %s", args, j.Latest())

return out, nil
}
Expand Down

0 comments on commit eb3556e

Please sign in to comment.