fix golint issues in core/fx (#486)

This commit is contained in:
Kevin Wan
2021-02-19 17:49:39 +08:00
committed by GitHub
parent c376ffc351
commit f238290dd3
6 changed files with 48 additions and 22 deletions

View File

@@ -8,12 +8,12 @@ import (
)
func TestRetry(t *testing.T) {
assert.NotNil(t, DoWithRetries(func() error {
assert.NotNil(t, DoWithRetry(func() error {
return errors.New("any")
}))
var times int
assert.Nil(t, DoWithRetries(func() error {
assert.Nil(t, DoWithRetry(func() error {
times++
if times == defaultRetryTimes {
return nil
@@ -22,7 +22,7 @@ func TestRetry(t *testing.T) {
}))
times = 0
assert.NotNil(t, DoWithRetries(func() error {
assert.NotNil(t, DoWithRetry(func() error {
times++
if times == defaultRetryTimes+1 {
return nil
@@ -32,11 +32,11 @@ func TestRetry(t *testing.T) {
var total = 2 * defaultRetryTimes
times = 0
assert.Nil(t, DoWithRetries(func() error {
assert.Nil(t, DoWithRetry(func() error {
times++
if times == total {
return nil
}
return errors.New("any")
}, WithRetries(total)))
}, WithRetry(total)))
}