forked from TrueCloudLab/frostfs-s3-gw
parent
60bc0037fd
commit
c7cf5afd2f
1 changed files with 26 additions and 0 deletions
26
api/errors_test.go
Normal file
26
api/errors_test.go
Normal file
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue