Skip to content
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: add a simpler sort.Interface example #6335

Closed
gopherbot opened this issue Sep 5, 2013 · 4 comments
Closed

sort: add a simpler sort.Interface example #6335

gopherbot opened this issue Sep 5, 2013 · 4 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 5, 2013

by Lytvynov.A.V:

Examples in package sort look a bit more complicated than a person new to it needs.
I'm referring specifically to sort.Interface example and SortKeys, SortMultiKeys
examples in the overview of the package.
These are great pieces of code and demonstrate language flexibility but they look rather
intimidating at first.

I propose replacing sort.Interface example (while still keeping the original one with a
different name) with something that clearly demonstrates usage of the interface, like: 
http://play.golang.org/p/WRY2lXlsiW

Also, this would be a better example to come first in the package overview, since
SortKeys example is too huge to introduce user to the package.
@robpike
Copy link
Contributor

@robpike robpike commented Sep 6, 2013

Comment 1:

Good suggestion and nice example.  The easiest way to make this happen is to send a CL.
You have the code; why not just send it?

Labels changed: added priority-later, go1.2maybe, documentation, removed priority-triage.

Status changed to Accepted.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Sep 6, 2013

Comment 2 by Lytvynov.A.V:

CL submitted at https://golang.org/cl/13586043/
I still don't like the overview of the package, though.
Maybe some reference to sort.Interface example would prevent someone from diving into
complicated examples first?
@robpike
Copy link
Contributor

@robpike robpike commented Sep 8, 2013

Comment 3:

This issue was closed by revision 467122c.

Status changed to Fixed.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Sep 16, 2013

Comment 4 by darkgray:

The new example still needs to be moved to the top of the doc page, if the
"intimidation" issue is to be addressed. First impressions, etc.
@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.