You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: testdata/main.go
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -664,6 +664,19 @@ func issue33() {
664
664
}
665
665
}
666
666
667
+
funcissue48() {
668
+
foo:=struct {
669
+
Lenfunc() int
670
+
}{
671
+
Len: func() int {
672
+
return10
673
+
},
674
+
}
675
+
676
+
fori:=0; i<foo.Len(); i++ { // want `for loop can be changed to use an integer range \(Go 1\.22\+\)\nBecause the key is returned by a function or method, take care to consider side effects.`
for i := range service.Methods().Len() { // want `for loop can be changed to use an integer range \(Go 1\.22\+\)`
535
+
for i := 0; i < service.Methods().Len(); i++ { // want `for loop can be changed to use an integer range \(Go 1\.22\+\)`
536
536
print(i)
537
537
}
538
538
}
@@ -664,6 +664,19 @@ func issue33() {
664
664
}
665
665
}
666
666
667
+
func issue48() {
668
+
foo := struct {
669
+
Len func() int
670
+
}{
671
+
Len: func() int {
672
+
return 10
673
+
},
674
+
}
675
+
676
+
for i := 0; i < foo.Len(); i++ { // want `for loop can be changed to use an integer range \(Go 1\.22\+\)\nBecause the key is returned by a function or method, take care to consider side effects.`
0 commit comments