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

proposal: sort: rename sort.Interface to sort.Sortable? #30795

Closed
harrisonthorne opened this issue Mar 13, 2019 · 3 comments
Closed

proposal: sort: rename sort.Interface to sort.Sortable? #30795

harrisonthorne opened this issue Mar 13, 2019 · 3 comments

Comments

@harrisonthorne
Copy link

@harrisonthorne harrisonthorne commented Mar 13, 2019

What version of Go are you using (go version)?

go version go1.12 linux/amd64

Just an idea: I figured that renaming sort.Interface to sort.Sortable would make a lot more sense, at least to me. I thought it's confusing as it is as I originally thought the documentation referred to a reflect.Interface instead of sort's own Interface type.

@agnivade
Copy link
Contributor

@agnivade agnivade commented Mar 13, 2019

I think the breakage of the code is not worth the benefit it brings. For Go2, we usually consider breaking changes when the benefit overweighs the cost it extracts.

@agnivade agnivade changed the title Rename sort.Interface to sort.Sortable? proposal: sort: rename sort.Interface to sort.Sortable? Mar 13, 2019
@gopherbot gopherbot added this to the Proposal milestone Mar 13, 2019
@gopherbot gopherbot added the Proposal label Mar 13, 2019
@agnivade agnivade added the Go2 label Mar 13, 2019
@harrisonthorne
Copy link
Author

@harrisonthorne harrisonthorne commented Mar 13, 2019

Yeah, makes sense to me. :) Do you see any downsides to adding

type Sortable Interface

to the package?

@beoran
Copy link

@beoran beoran commented Mar 13, 2019

You can do this yourself, if you use type Sortable = sort.Interface in your own projects.

@golang golang locked and limited conversation to collaborators Mar 17, 2020
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
4 participants
You can’t perform that action at this time.