forked from TrueCloudLab/frostfs-s3-gw
parent
f3a6636efd
commit
d332096598
18 changed files with 163 additions and 128 deletions
26
api/errors/errors_test.go
Normal file
26
api/errors/errors_test.go
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue