MCPcopy
hub / github.com/gin-gonic/gin / BenchmarkSliceValidationError

Function BenchmarkSliceValidationError

binding/default_validator_benchmark_test.go:13–27  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

11)
12
13func BenchmarkSliceValidationError(b *testing.B) {
14 const size int = 100
15 e := make(SliceValidationError, size)
16 for j := 0; j < size; j++ {
17 e[j] = errors.New(strconv.Itoa(j))
18 }
19
20 b.ReportAllocs()
21
22 for b.Loop() {
23 if len(e.Error()) == 0 {
24 b.Errorf("error")
25 }
26 }
27}

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected