this post was submitted on 20 Jul 2023
5 points (100.0% liked)
Golang
2199 readers
1 users here now
This is a community dedicated to the go programming language.
Useful Links:
Rules:
- Posts must be relevant to Go
- No NSFW content
- No hate speech, bigotry, etc
- Try to keep discussions on topic
- No spam of tools/companies/advertisements
- It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
probably not. Don't need it much. Using map gets you the same functionality
I find hacking maps to be sets with
map[T]bool
ormap[T]struct{}
to be awkward for the most rudimentary use case, membership checking, and downright onerous for anything more "complicated."I feel as though the datastructure "an unordered collection of things without duplicates, with constant time lookup" is so simple and useful, I don't see any reason to keep it out of the language.