by protomyth · 11y ago · 0 comments
func main(): int {
mut i := 0;
for i < 5 {
printf("i: %d\n", i);
i = i + 1;
}
return 0;
}
I'm really curious about 2 things: that for seems to really be a while. Why := in the declare and = in the assignment?In fact, this snippet is only a few deviations away from being valid Go code.
foo := 3
fooo = 4
The second line is invalid because fooo does not exist.I chose `:=` and `=` mostly because of personal preference.