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 the bug of multiple symbol(#267) #269
Conversation
v2/exchange_info_service.go
Outdated
symbols := "[" | ||
for i, pair := range pairs { | ||
if i != 0 { | ||
symbols += "," | ||
} | ||
symbols += "\"" + pair + "\"" | ||
} | ||
symbols += "]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just formatted your code in a cleaner way. You also need to import strings
package.
symbols := "[" | |
for i, pair := range pairs { | |
if i != 0 { | |
symbols += "," | |
} | |
symbols += "\"" + pair + "\"" | |
} | |
symbols += "]" | |
if len(pairs) == 0 { | |
s.symbols = "[]" | |
} else { | |
s.symbols = "[\"" + strings.Join(pairs, "\",\"") + "\"]" | |
} | |
return s |
@adshao any updates on this fix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests also should be updated. In the exchange_info_service_test.go the following line:
"symbols": symbols,
should be:
"symbols": "[\"ETHBTC\",\"LTCBTC\"]",
thanks @icamys |
I found a bug (#267) and tried to fix it.
Correct request format:
curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D"
or
curl -g GET 'https://api.binance.com/api/v3/exchangeInfo?symbols=["BTCUSDT","BNBBTC"]'