Fix number formatting in requests.
parent
4ebf01f875
commit
df54a3b11f
|
@ -6,7 +6,7 @@ type FixtureRequest struct{ request }
|
||||||
|
|
||||||
// Modifies the request to specify the number of former games to be analyzed (normally 10).
|
// Modifies the request to specify the number of former games to be analyzed (normally 10).
|
||||||
func (r FixtureRequest) Head2Head(num uint16) FixtureRequest {
|
func (r FixtureRequest) Head2Head(num uint16) FixtureRequest {
|
||||||
r.v.Set("head2head", fmt.Sprintf("%i", num))
|
r.v.Set("head2head", fmt.Sprintf("%d", num))
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,5 +23,5 @@ func (r FixtureRequest) Do() (s Fixture, err error) {
|
||||||
|
|
||||||
// Prepares a request to fetch the fixtures of a soccer season.
|
// Prepares a request to fetch the fixtures of a soccer season.
|
||||||
func (c *Client) Fixture(id uint64) FixtureRequest {
|
func (c *Client) Fixture(id uint64) FixtureRequest {
|
||||||
return FixtureRequest{c.req("fixture/%i", id)}
|
return FixtureRequest{c.req("fixture/%d", id)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@ func (r SoccerSeasonRequest) Do() (s SoccerSeason, err error) {
|
||||||
|
|
||||||
// Prepares a request to fetch the complete list of soccer seasons.
|
// Prepares a request to fetch the complete list of soccer seasons.
|
||||||
func (c *Client) SoccerSeason(id uint64) SoccerSeasonRequest {
|
func (c *Client) SoccerSeason(id uint64) SoccerSeasonRequest {
|
||||||
return SoccerSeasonRequest{c.req("soccerseasons/%i", id)}
|
return SoccerSeasonRequest{c.req("soccerseasons/%d", id)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ type SoccerSeasonFixturesRequest struct{ request }
|
||||||
|
|
||||||
// Modifies the request to specify a match day.
|
// Modifies the request to specify a match day.
|
||||||
func (r SoccerSeasonFixturesRequest) Matchday(matchday uint16) SoccerSeasonFixturesRequest {
|
func (r SoccerSeasonFixturesRequest) Matchday(matchday uint16) SoccerSeasonFixturesRequest {
|
||||||
r.v.Set("matchday", fmt.Sprintf("%i", matchday))
|
r.v.Set("matchday", fmt.Sprintf("%d", matchday))
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,5 +32,5 @@ func (r SoccerSeasonFixturesRequest) Do() (s FixtureList, err error) {
|
||||||
|
|
||||||
// Prepares a request to fetch the fixtures of a soccer season.
|
// Prepares a request to fetch the fixtures of a soccer season.
|
||||||
func (c *Client) FixturesOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonFixturesRequest {
|
func (c *Client) FixturesOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonFixturesRequest {
|
||||||
return SoccerSeasonFixturesRequest{c.req("soccerseasons/%i/fixtures", soccerSeasonId)}
|
return SoccerSeasonFixturesRequest{c.req("soccerseasons/%d/fixtures", soccerSeasonId)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ type SoccerSeasonLeagueTableRequest struct{ request }
|
||||||
|
|
||||||
// Modifies the request to specify a match day.
|
// Modifies the request to specify a match day.
|
||||||
func (r SoccerSeasonLeagueTableRequest) Matchday(matchday uint16) SoccerSeasonLeagueTableRequest {
|
func (r SoccerSeasonLeagueTableRequest) Matchday(matchday uint16) SoccerSeasonLeagueTableRequest {
|
||||||
r.v.Set("matchday", fmt.Sprintf("%i", matchday))
|
r.v.Set("matchday", fmt.Sprintf("%d", matchday))
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,5 +23,5 @@ func (r SoccerSeasonLeagueTableRequest) Do() (s SoccerSeason, err error) {
|
||||||
|
|
||||||
// Prepares a new request to fetch the league table of a given soccer season.
|
// Prepares a new request to fetch the league table of a given soccer season.
|
||||||
func (c *Client) LeagueTableOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonLeagueTableRequest {
|
func (c *Client) LeagueTableOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonLeagueTableRequest {
|
||||||
return SoccerSeasonLeagueTableRequest{c.req("soccerseasons/%i/leagueTable", soccerSeasonId)}
|
return SoccerSeasonLeagueTableRequest{c.req("soccerseasons/%d/leagueTable", soccerSeasonId)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@ func (r SoccerSeasonTeamsRequest) Do() (s TeamList, err error) {
|
||||||
|
|
||||||
// Prepares a new request to fetch the league table of a given soccer season.
|
// Prepares a new request to fetch the league table of a given soccer season.
|
||||||
func (c *Client) TeamsOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonTeamsRequest {
|
func (c *Client) TeamsOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonTeamsRequest {
|
||||||
return SoccerSeasonTeamsRequest{c.req("soccerseasons/%i/leagueTable", soccerSeasonId)}
|
return SoccerSeasonTeamsRequest{c.req("soccerseasons/%d/leagueTable", soccerSeasonId)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ type SoccerSeasonsRequest struct{ request }
|
||||||
|
|
||||||
// Modifies the request to specify a season.
|
// Modifies the request to specify a season.
|
||||||
func (r SoccerSeasonsRequest) Season(num uint32) SoccerSeasonsRequest {
|
func (r SoccerSeasonsRequest) Season(num uint32) SoccerSeasonsRequest {
|
||||||
r.v.Set("season", fmt.Sprintf("%i", num))
|
r.v.Set("season", fmt.Sprintf("%d", num))
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,5 +22,5 @@ func (r TeamRequest) Do() (s Team, err error) {
|
||||||
|
|
||||||
// Prepares a request to fetch a team's information.
|
// Prepares a request to fetch a team's information.
|
||||||
func (c *Client) Team(id uint64) TeamRequest {
|
func (c *Client) Team(id uint64) TeamRequest {
|
||||||
return TeamRequest{c.req("teams/%i", id), id}
|
return TeamRequest{c.req("teams/%d", id), id}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ func (r TeamFixturesRequest) TimeFrame(timeframe time.Duration) TeamFixturesRequ
|
||||||
|
|
||||||
// Modifies the request to specify a list of leagues by their code.
|
// Modifies the request to specify a list of leagues by their code.
|
||||||
func (r TeamFixturesRequest) Season(season uint64) TeamFixturesRequest {
|
func (r TeamFixturesRequest) Season(season uint64) TeamFixturesRequest {
|
||||||
r.v.Set("season", fmt.Sprintf("%i", season))
|
r.v.Set("season", fmt.Sprintf("%d", season))
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,5 +38,5 @@ func (r TeamFixturesRequest) Do() (s FixturesResponse, err error) {
|
||||||
|
|
||||||
// Prepares a request to fetch the fixtures of a soccer season.
|
// Prepares a request to fetch the fixtures of a soccer season.
|
||||||
func (c *Client) FixturesOfTeam(id uint64) TeamFixturesRequest {
|
func (c *Client) FixturesOfTeam(id uint64) TeamFixturesRequest {
|
||||||
return TeamFixturesRequest{c.req("teams/%i/fixtures", id)}
|
return TeamFixturesRequest{c.req("teams/%d/fixtures", id)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@ func (r TeamPlayersRequest) Do() (s PlayerList, err error) {
|
||||||
|
|
||||||
// Prepares a request to fetch a team's players.
|
// Prepares a request to fetch a team's players.
|
||||||
func (c *Client) PlayersOfTeam(id uint64) TeamPlayersRequest {
|
func (c *Client) PlayersOfTeam(id uint64) TeamPlayersRequest {
|
||||||
return TeamPlayersRequest{c.req("teams/%i/players", id)}
|
return TeamPlayersRequest{c.req("teams/%d/players", id)}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue