d332096598
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
26 lines
378 B
Go
26 lines
378 B
Go
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
|
|
}
|
|
}
|
|
}
|