Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-08-09 11:53:58 +03:00 committed by Kirillov Denis
parent f3a6636efd
commit d332096598
18 changed files with 163 additions and 128 deletions

26
api/errors/errors_test.go Normal file
View file

@ -0,0 +1,26 @@
package errors
import (
"errors"
"testing"
)
func BenchmarkErrCode(b *testing.B) {
err := GetAPIError(ErrNoSuchKey)
for i := 0; i < b.N; i++ {
if IsS3Error(err, ErrNoSuchKey) {
_ = err
}
}
}
func BenchmarkErrorsIs(b *testing.B) {
err := GetAPIError(ErrNoSuchKey)
for i := 0; i < b.N; i++ {
if errors.Is(err, GetAPIError(ErrNoSuchKey)) {
_ = err
}
}
}