run gofumpt

This commit is contained in:
Matthew Penner
2022-02-23 15:01:03 -07:00
parent 067ca5bb60
commit 3a738e44d6
14 changed files with 19 additions and 22 deletions

View File

@@ -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 {

View File

@@ -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()
})
}()

View File

@@ -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()
}
}

View File

@@ -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()