mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
lint: enable intrange linter (#7331)
Enable intrange linter to enforce modern Go range syntax over traditional for loops, by converting: for i := 0; i < n; i++ to: for i := range n Adding type conversions where needed for compatibility with existing uint64 parameters. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -276,7 +276,7 @@ func BenchmarkReplacer(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
|
||||
replacer := New()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
replacer.Replace(context.TODO(), state, nil, "{type} {name} {size}")
|
||||
}
|
||||
}
|
||||
@@ -297,13 +297,13 @@ func BenchmarkReplacer_CommonLogFormat(b *testing.B) {
|
||||
|
||||
b.ResetTimer()
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
replacer.Replace(ctxt, state, w, CommonLogFormat)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkParseFormat(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
parseFormat(CommonLogFormat)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user