Closed ashwek closed 2 years ago
I had the exact same question... @deckarep when you release the generics-compatible version, maybe take that opportunity to also cleanup the API slightly and remove NewSetWith()
?
Would it also make sense to remove NewSetFromSlice([]elt)
given that someone could write the NewSet([]elt...)
and it'd be functionally equivalent and fewer characters... ??
This could easily be fixed by #83 combined with #84.
How is
NewSet
different fromNewSetWith
?https://github.com/deckarep/golang-set/blob/645e1ba83b7fdd0baab3f586c30a4d1619c71f99/set.go#L178-L180
https://github.com/deckarep/golang-set/blob/645e1ba83b7fdd0baab3f586c30a4d1619c71f99/set.go#L188-L190
According to
NewSet
's documentation, it returns reference to an empty set. But that's not true. It returns reference to a set with all the items passed in parameters.That's exactly what
NewSetWith
does. So how are they different?Am i missing something here?