mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -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:
@@ -169,7 +169,7 @@ func BenchmarkFileLookupDNSSEC(b *testing.B) {
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
fm.ServeDNS(ctx, rec, m)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func BenchmarkFileParseInsert(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
Parse(strings.NewReader(dbMiekENTNL), testzone, "stdin", 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ func BenchmarkFileLookup(b *testing.B) {
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
fm.ServeDNS(ctx, rec, m)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ Tests:
|
||||
}
|
||||
|
||||
sort.Sort(set(test.in))
|
||||
for i := 0; i < len(test.in); i++ {
|
||||
for i := range len(test.in) {
|
||||
if test.in[i] != test.out[i] {
|
||||
t.Errorf("Test %d: expected %s, got %s", j, test.out[i], test.in[i])
|
||||
n := ""
|
||||
|
||||
Reference in New Issue
Block a user