-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sort: possibility for deduplication #12763
Comments
CL https://golang.org/cl/15016 mentions this issue. |
A general advice: when you file an API addition issue, before
sending CL for review, please at least wait for some consensus
on the issue tracker.
As Burcu mentioned in the code review, I don't think this functions
belongs to the sort package. If we have a sortutil package, perhaps.
|
sortutil.Dedupe ;-) |
Generally, it is better to propose new APIs on golang-dev mailing list first where more contributors are actively watching each discussion. We need to discuss this function's value with other contributors to reason why it should or should not be merged into the standard library and where it would fit. |
Actually the correct place to propose new API additions and other changes is through the issue tracker. |
I don't think this needs to live in the standard library, here is an http://godoc.org/github.com/xtgo/set#Uniq On Mon, Sep 28, 2015 at 12:44 PM, Andrew Gerrand notifications@github.com
|
Hi I'm missing the possibility for sorting+dedup via std lib.
So I implemented a function DedupSorted(data Interface) (n int) for the sort package.
It rearranges different elements of data to the front of the Interface
preserving order and returns the number of different elements.
So for example if I want to sort+dedup a slice of strings:
would give me
If there is already something like this I would be happy to know and I'm sorry for filing this issue.
Comments are welcome.
Marvin
The text was updated successfully, but these errors were encountered: