"A set can be implemented as a map with value type bool. Set the map entry to true to put the value in the set, and then test it by simple indexing."
if m[key] {
// found
}
I'd say the former is the right choice for 97.25% of general use cases.
--
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.