hashicorp / go-set

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

add ability to set custom hashing function #5

Closed shoenig closed 2 years ago

shoenig commented 2 years ago

Currently go-set only works with types that work as keys in a map - and the intrinsic hashing of those types are used for equality comparison.

A Set could be useful for more use cases if the user could specify how objects that get put into the set are hashed. Say for example an object implements Hash() string or HashCode() int, etc.