Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

API wapper for api/trades #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

API wapper for api/trades #6

wants to merge 1 commit into from

Conversation

lqiz
Copy link

@lqiz lqiz commented Jun 17, 2018

GET /api/v1/trades
Get recent trades (up to last 500).

res, err := as.request("GET", "api/v1/trades", params, false, false)
if err != nil {
return nil, err
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defer must be here!

defer res.Body.Close()

return nil, errors.Wrap(err, "rawRecentTrades unmarshal failed")
}

var recentTrades []*RecentTrades
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recentTrades := make([]*RecentTrades, 0, len(rawRecentTrades))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants