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 the bug of multiple symbol(#267) #269

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions v2/exchange_info_service.go
Expand Up @@ -3,13 +3,14 @@ package binance
import (
"context"
"encoding/json"
"strings"
)

// ExchangeInfoService exchange info service
type ExchangeInfoService struct {
c *Client
symbol string
symbols []string
symbols string
}

// Symbol set symbol
Expand All @@ -19,8 +20,12 @@ func (s *ExchangeInfoService) Symbol(symbol string) *ExchangeInfoService {
}

// Symbols set symbol
func (s *ExchangeInfoService) Symbols(symbols ...string) *ExchangeInfoService {
s.symbols = symbols
func (s *ExchangeInfoService) Symbols(pairs ...string) *ExchangeInfoService {
if len(pairs) == 0 {
s.symbols = "[]"
} else {
s.symbols = "[\"" + strings.Join(pairs, "\",\"") + "\"]"
}
return s
}

Expand Down