bbgo: add stringer method to the quota struct

This commit is contained in:
c9s 2024-09-03 03:26:47 +08:00 committed by lychiyu
parent b99f49c8b8
commit 0b572aa967

View File

@ -51,6 +51,13 @@ func (q *Quota) Rollback() {
q.mu.Unlock()
}
func (q *Quota) String() string {
q.mu.Lock()
defer q.mu.Unlock()
return q.Locked.String() + "/" + q.Available.String()
}
// QuotaTransaction is a transactional quota manager
type QuotaTransaction struct {
mu sync.Mutex