Skip to content
Myr

default_validator_benchmark_test.go

This file

Path

binding/default_validator_benchmark_test.go

27 lines · 494 bytes · Go

Last changed by

refactor: use b.Loop() to simplify the code and improve performance (#4432)efckingbefore adoptiona85ef5c

History of this file

Take it

The walk stopped after 200 commits: lines older than cf32d2d point at it.

chore(deps): bump github.com/pelletier/go-toml/v2 from 2.2.2 to 2.2.4 (#4212)dependabot[bot]before adoptioncf32d2d

lines 1–21why, one step back
1// Copyright 2022 Gin Core Team. All rights reserved.
2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package binding67import (8 "errors"9 "strconv"10 "testing"11)1213func BenchmarkSliceValidationError(b *testing.B) {14 const size int = 10015 e := make(SliceValidationError, size)16 for j := 0; j < size; j++ {17 e[j] = errors.New(strconv.Itoa(j))18 }1920 b.ReportAllocs()21

refactor: use b.Loop() to simplify the code and improve performance (#4432)efckingbefore adoptiona85ef5c

line 22why, one step back
22 for b.Loop() {

chore(deps): bump github.com/pelletier/go-toml/v2 from 2.2.2 to 2.2.4 (#4212)dependabot[bot]before adoptioncf32d2d

lines 23–27why, one step back
23 if len(e.Error()) == 0 {
24 b.Errorf("error")25 }26 }27}