fixed string conversion to Itoa

This commit is contained in:
Thomas Bennett 2016-05-15 11:47:50 -07:00
parent d4eba2ba44
commit f7ac04ea6a
1 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"net/url" "net/url"
"strconv"
) )
func (h *Halo) EventsForMatch(matchid string) (EventsForMatchStruct, error) { func (h *Halo) EventsForMatch(matchid string) (EventsForMatchStruct, error) {
@ -41,10 +42,10 @@ func (h *Halo) MatchesForPlayer(player, modes string, start, count int) (Matches
q.Set("modes", modes) q.Set("modes", modes)
} }
if start != 0 { if start != 0 {
q.Set("start", string(start)) q.Set("start", strconv.Itoa(start))
} }
if count != 0 { if count != 0 {
q.Set("count", string(count)) q.Set("count", strconv.Itoa(count))
} }
url.RawQuery = q.Encode() url.RawQuery = q.Encode()
jsonObject, err := h.sendRequest(url.String()) jsonObject, err := h.sendRequest(url.String())
@ -72,7 +73,7 @@ func (h *Halo) PlayerLeaderboard(seasonid, playlistid string, count int) (Player
q := url.Query() q := url.Query()
if count != 0 { if count != 0 {
q.Set("count", string(count)) q.Set("count", strconv.Itoa(count))
} }
url.RawQuery = q.Encode() url.RawQuery = q.Encode()
jsonObject, err := h.sendRequest(url.String()) jsonObject, err := h.sendRequest(url.String())