下面这段代码很神奇

openset · · 1458 次点击
The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next. If a map entry that has not yet been reached is removed during iteration, the corresponding iteration value will not be produced. If a map entry is created during iteration, that entry may be produced during the iteration or may be skipped. The choice may vary for each entry created and from one iteration to the next. If the map is nil, the number of iterations is 0. From: https://golang.org/ref/spec
#7
更多评论
The range expression x is evaluated once before beginning the loop
#2