The go-set package provides generic Set implementations for Go, including HashSet for types with a Hash() function and TreeSet for orderable data
Mozilla Public License 2.0
118
stars
8
forks
source link
set: add a FromFunc set constructor #6
Closed
shoenig closed 2 years ago
This PR adds FromFunc for conveniently constructing a set from a slice of objects, where we only care about some comparable aspect of the object.
e.g. - something like this
would become