I was assuming I can use any operator to increment the incrementing variable in for loop. Looks like it's not the case. Following code loops for ever.
import (
"fmt"
)
func main() {
for i:=0; i<10; i=i*2{
fmt.Println(i)
}
}
Following code works fine.
import (
"fmt"
)
func main() {
for i:=0; i<10; i=i+2{
fmt.Println(i)
}
}