run gofumpt
This commit is contained in:
@@ -42,7 +42,6 @@ func (l *Locker) Acquire() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
// TryAcquire will attempt to acquire a power-lock until the context provided
|
||||
// is canceled.
|
||||
func (l *Locker) TryAcquire(ctx context.Context) error {
|
||||
|
||||
@@ -95,7 +95,7 @@ func TestPower(t *testing.T) {
|
||||
|
||||
l.Acquire()
|
||||
go func() {
|
||||
time.AfterFunc(time.Millisecond * 50, func() {
|
||||
time.AfterFunc(time.Millisecond*50, func() {
|
||||
l.Release()
|
||||
})
|
||||
}()
|
||||
|
||||
@@ -44,7 +44,7 @@ func (r *Rate) Try() bool {
|
||||
// Reset resets the internal state of the rate limiter back to zero.
|
||||
func (r *Rate) Reset() {
|
||||
r.mu.Lock()
|
||||
r.count = 0
|
||||
r.last = time.Now()
|
||||
r.count = 0
|
||||
r.last = time.Now()
|
||||
r.mu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func TestRate(t *testing.T) {
|
||||
g.It("resets back to zero when called", func() {
|
||||
r := NewRate(10, time.Second)
|
||||
for i := 0; i < 100; i++ {
|
||||
if i % 10 == 0 {
|
||||
if i%10 == 0 {
|
||||
r.Reset()
|
||||
}
|
||||
g.Assert(r.Try()).IsTrue()
|
||||
|
||||
Reference in New Issue
Block a user