I added the following test here, and no errors or issues are displayed:
func TestForLoop(t *testing.T) {
testsetup()
for i := 0; i < 3; i++ {
os.Setenv("a", "b") // want "os\\.Setenv\\(\\) can be replaced by `f\\.Setenv\\(\\)` in TestForLoop"
}
}
The real use case of a for loop would most often be a map of key:value pairs, but a simple loop exposes the lack of issues being reported.
I believe this should be detected and reported as an error in lint.
I added the following test here, and no errors or issues are displayed:
The real use case of a
for
loop would most often be a map ofkey:value
pairs, but a simple loop exposes the lack of issues being reported.I believe this should be detected and reported as an error in lint.