mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
bbgo: add stringer method to the quota struct
This commit is contained in:
parent
7135895006
commit
7d034d1ba8
|
@ -51,6 +51,13 @@ func (q *Quota) Rollback() {
|
||||||
q.mu.Unlock()
|
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
|
// QuotaTransaction is a transactional quota manager
|
||||||
type QuotaTransaction struct {
|
type QuotaTransaction struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
|
|
Loading…
Reference in New Issue
Block a user