|
|
|
|
|
by cpalone
3771 days ago
|
|
> Why just maps? why not sets, with useful set methods ? Having programmed in Go for production a while now, in my experience it's rarely necessary. Sometimes a set is needed, but it's very simple to just use a map[T]struct{}. And if something like union or intersect is needed it's usually less than 20 lines to implement all those operations. Usually that operation is only needed in one instance, and it's very quick to write. Would it be faster to have a builtin generic set? Absolutely, but it's such a small inconvenience I honestly don't care. |
|