diff --git a/api/errors_test.go b/api/errors_test.go new file mode 100644 index 00000000..17e272e8 --- /dev/null +++ b/api/errors_test.go @@ -0,0 +1,26 @@ +package api + +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 + } + } +}