3 ms·
Since iterating on maps in Go always results in copying the value then I'd guess the first piece of code does what is expected due to that, and the second does
by pdimitar 3y ago
Since iterating on maps in Go always results in copying the value then I'd guess the first piece of code does what is expected due to that, and the second does not because `a` will only ever have the value of the last element of `alarms` (the original problem described in the article).