Closed
Description
The code below can run but the go plugin says it contains an error:
package main
import (
"fmt"
"strconv"
)
func main() {
ShouldAllowParameterShadowing("param")
}
func ShouldAllowParameterShadowing(i string) {
fmt.Println(i)
for i := 0; i < 3; i++ { // Inspection error "No new variables on left side of :="
fmt.Println(strconv.Itoa(i))
}
}
But it will run correctly and output:
$ go run main.go
param
0
1
2