rename Error to Err

This commit is contained in:
v2ray committed 2016-06-27 08:53:35 +02:00
1 parent 5ee87404fd
commit 7f661f5215
41 files changed
+118 -118

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ import (
)
var (
ErrorRetryFailed = errors.New("All retry attempts failed.")
ErrRetryFailed = errors.New("All retry attempts failed.")
)
// Strategy is a way to retry on a specific function.
@@ -29,7 +29,7 @@ func (r *retryer) On(method func() error) error {
}
delay := r.NextDelay(attempt)
if delay < 0 {
return ErrorRetryFailed
return ErrRetryFailed
}
<-time.After(time.Duration(delay) * time.Millisecond)
attempt++
+1 -1
View File
@@ -76,6 +76,6 @@ func TestRetryExhausted(t *testing.T) {
})
duration := time.Since(startTime)
assert.Error(err).Equals(ErrorRetryFailed)
assert.Error(err).Equals(ErrRetryFailed)
assert.Int64(int64(duration / time.Millisecond)).AtLeast(1900)
}