bbgo: add stringer method to the quota struct
Some checks failed
Go / build (1.21, 6.2) (push) Has been cancelled
golang-lint / lint (push) Has been cancelled

This commit is contained in:
c9s 2024-09-03 03:26:47 +08:00
parent 7135895006
commit 7d034d1ba8
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

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