Skip to content

Commit e914fa2

Browse files
committed
(*Bar).SetRefillCurrent
Convenience method.
1 parent 3304512 commit e914fa2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bar.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"context"
66
"io"
7+
"math"
78
"strings"
89
"time"
910

@@ -149,6 +150,11 @@ func (b *Bar) SetRefill(amount int64) {
149150
}
150151
}
151152

153+
// SetRefillCurrent sets refill to the current amount.
154+
func (b *Bar) SetRefillCurrent() {
155+
b.SetRefill(math.MaxInt64)
156+
}
157+
152158
// TraverseDecorators traverses available decorators and calls `cb`
153159
// on each unwrapped one.
154160
func (b *Bar) TraverseDecorators(cb func(decor.Decorator)) {

0 commit comments

Comments
 (0)