deckarep / golang-set

A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp.
Other
4k stars 272 forks source link

Suggestion: option to restrict comparable to only exported values. #136

Open dmichmer opened 2 months ago

dmichmer commented 2 months ago

I use the testify/assert package in unit testing and they have a very helpful ability to compare two structs based only on exported values. This makes it possible for me to compare GRPC generated structs which have (generated) internal members that differ.

https://pkg.go.dev/github.com/stretchr/testify/assert#EqualExportedValues

This would be a very useful option for constructing sets as well.

deckarep commented 2 months ago

Hi,

Thanks for the comment but I do largely consider this package to be neutral to other testing packages aside from Go's standard lib flavor of testing.

I know testify is popular and I've used it before in some projects but would such a change be applicable to other projects, people and usages of this repo?