chore: refactor errors (#3651)

This commit is contained in:
Kevin Wan
2023-10-20 14:58:38 +08:00
committed by GitHub
parent 151768ef82
commit 944e76edb9
3 changed files with 5 additions and 6 deletions

View File

@@ -95,7 +95,7 @@ func TestGoogleBreakerAcceptable(t *testing.T) {
assert.Equal(t, errAcceptable, b.doReq(func() error {
return errAcceptable
}, nil, func(err error) bool {
return err == errAcceptable
return errors.Is(err, errAcceptable)
}))
}
@@ -105,7 +105,7 @@ func TestGoogleBreakerNotAcceptable(t *testing.T) {
assert.Equal(t, errAcceptable, b.doReq(func() error {
return errAcceptable
}, nil, func(err error) bool {
return err != errAcceptable
return !errors.Is(err, errAcceptable)
}))
}