Is there an explanation why for loop using uint64 wouldn't stop at 0?
I've tried the same for loop with int and it works as expected.
package main
import (
"fmt"
)
func main() {
i := uint64(5)
for ; i>=uint64(0); i-- {
fmt.Printf("step %d
", i)
}
}
I would expect this function to stop at output step 0
but it overflows the int and continues forever with step 18446744073709551615
and so on