fix golint issues

This commit is contained in:
kevin
2020-10-16 11:13:55 +08:00
parent 94645481b1
commit fe3739b7f3
9 changed files with 41 additions and 49 deletions

View File

@@ -2,7 +2,6 @@ package breaker
import (
"errors"
"math"
"math/rand"
"testing"
"time"
@@ -157,7 +156,7 @@ func TestGoogleBreakerSelfProtection(t *testing.T) {
t.Run("total request > 100, total < 2 * success", func(t *testing.T) {
b := getGoogleBreaker()
size := rand.Intn(10000)
accepts := int(math.Ceil(float64(size))) + 1
accepts := size + 1
markSuccess(b, accepts)
markFailed(b, size-accepts)
assert.Nil(t, b.accept())