2022-05-28 02:42:28 +00:00
|
|
|
// Copyright 2022 Gin Core Team. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2021-06-28 14:05:29 +00:00
|
|
|
package binding
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"strconv"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2021-11-21 13:45:03 +00:00
|
|
|
func BenchmarkSliceValidationError(b *testing.B) {
|
2021-06-28 14:05:29 +00:00
|
|
|
const size int = 100
|
|
|
|
for i := 0; i < b.N; i++ {
|
2021-11-21 13:45:03 +00:00
|
|
|
e := make(SliceValidationError, size)
|
2021-06-28 14:05:29 +00:00
|
|
|
for j := 0; j < size; j++ {
|
|
|
|
e[j] = errors.New(strconv.Itoa(j))
|
|
|
|
}
|
|
|
|
if len(e.Error()) == 0 {
|
|
|
|
b.Errorf("error")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|