improvement

This commit is contained in:
irlndts 2018-01-22 21:15:06 +03:00
parent 72a2e61894
commit 055007c459

View File

@ -41,8 +41,8 @@ type Release struct {
Year int `json:"year"` Year int `json:"year"`
} }
type RequestRelease struct { type ReqRelease struct {
Curr_abbr string CurrAbbr string
} }
// Release returns release by release's ID // Release returns release by release's ID
@ -50,7 +50,7 @@ func (c *Client) Release(releaseID int) (*Release, error) {
release := new(Release) release := new(Release)
apiError := new(APIError) apiError := new(APIError)
req := &RequestRelease{Curr_abbr: c.currency} req := &ReqRelease{CurrAbbr: c.currency}
_, err := c.api.New().Get("releases/"+strconv.Itoa(releaseID)).QueryStruct(req).Receive(release, apiError) _, err := c.api.New().Get("releases/"+strconv.Itoa(releaseID)).QueryStruct(req).Receive(release, apiError)
return release, relevantError(err, *apiError) return release, relevantError(err, *apiError)
} }