Skip to content

Commit 0f64498

Browse files
committed
Use for range for integers
This uses more idiomatic Go 1.22 style. Generated by: modernize -rangeint -fix ./... Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1 parent 1d45fd3 commit 0f64498

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

command_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5420,7 +5420,7 @@ func TestCommand_ExclusiveFlagsWithAfter(t *testing.T) {
54205420
func TestCommand_ParallelRun(t *testing.T) {
54215421
t.Parallel()
54225422

5423-
for i := 0; i < 10; i++ {
5423+
for i := range 10 {
54245424
t.Run(fmt.Sprintf("run_%d", i), func(t *testing.T) {
54255425
t.Parallel()
54265426

suggestions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func jaroWinkler(a, b string) float64 {
9292
prefix := int(math.Min(float64(len(a)), math.Min(float64(prefixSize), float64(len(b)))))
9393

9494
var prefixMatch float64
95-
for i := 0; i < prefix; i++ {
95+
for i := range prefix {
9696
if a[i] == b[i] {
9797
prefixMatch++
9898
} else {

0 commit comments

Comments
 (0)