deckarep / golang-set

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

why isn't there a `mapset.NewSetFromSlice` method? #137

Closed ibukunoluwayomi closed 2 months ago

ibukunoluwayomi commented 5 months ago

Just like mapset.NewSetFromMapKeys() which is very handy. I think mapset.NewSetFromSlice will be quite helpful

deckarep commented 5 months ago

Hello,

I believe we used to have such methods but they've been streamlines by having some of the New* functions be variadic which means you can still pass a slice in and would just need to expand it with the .. syntax.

Let me know if that is what you're looking for.

Thanks,

-Deckarep