mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
types: remove slice preallocated cap
This commit is contained in:
parent
2b264905f9
commit
d60a82256d
|
@ -2,6 +2,7 @@ package types
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -25,6 +26,15 @@ func (b Balance) String() string {
|
|||
|
||||
type BalanceMap map[string]Balance
|
||||
|
||||
func (m BalanceMap) String() string {
|
||||
var ss []string
|
||||
for _, b := range m {
|
||||
ss = append(ss, b.String())
|
||||
}
|
||||
|
||||
return "BalanceMap[" + strings.Join(ss, ", ") + "]"
|
||||
}
|
||||
|
||||
func (m BalanceMap) Print() {
|
||||
for _, balance := range m {
|
||||
if balance.Available == 0 && balance.Locked == 0 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user