package main
import (
"fmt"
)
func main() {
m := make(map[int]int, 4)
m[1] = 0
m[2] = 0
for k, _ := range m {
i := 10 + k
m[i] = 0
}
fmt.Println(m)
fmt.Println("len:", len(m))
}
This code returns: 8 or 10 or 6 as length of map after loop. Video is here, playgroud here.
I see that new added elements go into range, but can't explain why this loop stops randomly?