Skip to content

Commit

Permalink
fix: close body; update: naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrynenko committed May 31, 2024
1 parent d7c6eab commit 2be4a12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/config/price.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type QuoteResponse struct {
}

type Currency struct {
Id int `json:"id"`
ID int `json:"id"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Quote map[string]Quote `json:"quote"`
Expand Down Expand Up @@ -102,6 +102,7 @@ func (cfg PriceAPIConfig) ConvertPrice() (*big.Float, error) {
if err != nil {
return nil, errors.Wrap(err, "failed to do request")
}
defer response.Body.Close()

if response.StatusCode != http.StatusOK {
body, err := io.ReadAll(response.Body)
Expand Down

0 comments on commit 2be4a12

Please sign in to comment.