Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For those interested, this was added a few months before Go 1.0:

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/



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: