alphabetical: pull the keys or key-value pairs into a slice + sort.
LIFO: use a slice
FIFO: use a channel
That's the great thing about Go. There's never a matter of what "Go" has. There's always someone out there who has written a package to do it, and it's trivial to get it, and adding it to your project doesn't cost anyone else any problems since they get it automatically with your project.
--
Of course, I'd be lying if I said that I trust all Go programmers (e.g., author of package X on github) as much as, say, Rob Pike.
Maybe this isn't entirely rational, but when I see something in the standard library it makes me feel confident, like it's been quite thoroughly tested and isn't going to cause me a heart attack when we deploy. This helps me sleep at nights when I'm putting code into production.
On the other hand, when I use a 3rd party package, there's always a nagging feeling in the back of my mind that some critical bug is going to pop out after I've deployed. There's something to be said for this peace of mind, whether or not it is warranted. (And I honestly believe for the large part, the peace of mind that comes from using the standard library IS warranted.)
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.