content/go-maps-in-action: remove line about random iteration order
This article is cited as a source of confusion on whether map iteration is "random",
something that is objectively correct because woefully underdefined, but that some
have assumed to mean "uniformly random" - which is not:
Based on golang.org/cl/180457 by Carlo Alberto Ferraris
Reviewed-by: Bryan C. Mills <email@example.com>
diff --git a/content/go-maps-in-action.article b/content/go-maps-in-action.article
index 7cca838..cc6d62c 100644
@@ -156,7 +156,7 @@
To read from the counter, take the read lock:
n := counter.m["some_key"]
@@ -171,8 +171,6 @@
* Iteration order
When iterating over a map with a range loop, the iteration order is not specified and is not guaranteed to be the same from one iteration to the next.
-Since the release of Go 1.0, the runtime has randomized map iteration order.
-Programmers had begun to rely on the stable iteration order of early versions of Go, which varied between implementations, leading to portability bugs.
If you require a stable iteration order you must maintain a separate data structure that specifies that order.
This example uses a separate sorted slice of keys to print a `map[int]string` in key order: