10 ms·
For those interested, this was added a few months before Go 1.0: https://codereview.appspot.com/5285042/ https://codereview.appspot.com/5285042/ This has prov
by crawshaw 13y ago
For those interested, this was added a few months before Go 1.0:
https://codereview.appspot.com/5285042/ https://codereview.appspot.com/5285042/
This has proven surprisingly useful in cutting down on fragile tests, where order was relied on for a set of items, the code was later changed to insert in a different order, and then the test was exposed as never being right.
Also of note, if you range over map of comparable keys with text/template, the order is reliable: http://golang.org/pkg/text/template/ http://golang.org/pkg/text/template/