Open Luoxin opened 3 years ago
I have made some attempts
@elliotchance What is the actual status? I would be happy to add similar function with index based removing in Go idiomatic(but not perfect) way s = append(s[:idx], s[idx+1:]...)
within. I guess behaviour described above is exactly the same as Intersect
Intersect creates a set of elements that exist in both sets. I believe what @Luoxin is talking about here is "except" which results in the elements that do not exist in another set.
Speaking more broadly, it would be nice to have a Set type in this library for dealing with unordered unique items where these kinds of operations make sense. Otherwise, union operations on non-unique elements can be ambiguous.
Of course, Except
I want to add removeļ¼like:
In some scenarios, there will be a desire to weed out the data in slice A from the data in slice B