With enough consumers, every observable property of an API is part of the contract: JSON key order, latency, error message text.
// proverb level: don't let anyone observe what you don't promise
// map deliberately randomizes iteration order: the language defends against Hyrum's Law
for k := range m { ... } // order differs on every pass; nothing to rely on// same here: Set.of()/Map.of() randomize iteration order across JVM runs
// precisely so that nobody starts depending on itPrecision. The Go spec says map iteration order is unspecified and not guaranteed to be the same from one iteration to the next, not that it is “random and always different.” The practical conclusion is the same: you must not depend on it. But the word “randomizes” describes the implementation, not the language contract.
The mechanisms also differ in strength. The Go runtime picks random offsets every time an iterator is initialized: two iterations over the same unmodified map in one process yield different orders. Java computes SALT once at JVM startup (ImmutableCollections; the source comment names the goal outright: “iteration order will vary between JVM runs”): within a run the order is stable, across runs it differs. The contract is the same for both: order is unspecified. What differs is how insistently the implementation keeps you from relying on it, and that itself may change in the next release, which is the main argument for not relying on it.