Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on getting exchange info with multiple symbols (issue #269) #315

Merged
merged 2 commits into from Oct 13, 2021

Conversation

icamys
Copy link
Contributor

@icamys icamys commented Oct 5, 2021

A solution similar to #267 , but includes tests.

if len(symbols) == 0 {
s.symbols = "[]"
} else {
s.symbols = "[\"" + strings.Join(symbols, "\",\"") + "\"]"
Copy link
Owner

Choose a reason for hiding this comment

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

Can we use json.Marshal instead of manually concatenating json strings?

Copy link
Contributor Author

@icamys icamys Oct 11, 2021

Choose a reason for hiding this comment

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

@adshao Thanks for responding. I would prefer concatenation for three reasons:

  1. It's the fastest way to get the needed string
  2. json.Marshall returns an error that should be either ignored or handled - unnecessary code and memory allocation
  3. json.Marshall returns bytes that should be further converted to string - unnecessary operation and memory allocation

Copy link
Owner

Choose a reason for hiding this comment

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

thanks @icamys , this looks good to me, could you please rebase the code since there is code conflict with the master branch.

Copy link
Contributor Author

@icamys icamys Oct 12, 2021

Choose a reason for hiding this comment

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

@adshao Done.

@adshao adshao merged commit 7ef5265 into adshao:master Oct 13, 2021
@icamys icamys deleted the patch-1 branch July 19, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants