2021-08-09 08:53:58 +00:00
|
|
|
package errors
|
2021-07-21 09:05:24 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|