You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// NewSetWith creates and returns a new set with the given elements.
// Operations on the resulting set are thread-safe.
funcNewSetWith(elts...interface{}) Set {
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?
The text was updated successfully, but these errors were encountered:
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... ??
How is
NewSet
different fromNewSetWith
?golang-set/set.go
Lines 178 to 180 in 645e1ba
golang-set/set.go
Lines 188 to 190 in 645e1ba
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?
The text was updated successfully, but these errors were encountered: