Skip to content

sort.IntArray is a misleading type name #1945

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

Closed
gopherbot opened this issue Jun 10, 2011 · 2 comments
Closed

sort.IntArray is a misleading type name #1945

gopherbot opened this issue Jun 10, 2011 · 2 comments

Comments

@gopherbot
Copy link
Contributor

by jeremy.f.stephens:

This isn't a bug per se, but it's a bit confusing for someone learning Go (like myself).

In the Go tutorial, the sort package is introduced and the sort.IntArray type is
mentioned. But this type isn't an int array, it's an int slice. I found the concepts of
slices to be a bit confusing at first, and this aggravated my confusion somewhat.

Similarly, the tutorial creates a type dayArray, which is a struct that contains a slice
of pointers.

Is there any interest in renaming these types to IntSlice and daySlice? I think it would
help. Or, it would be helpful if the tutorial explicitly said, "sort.IntArray is
actually a slice".

Thanks!
@rsc
Copy link
Contributor

rsc commented Jun 10, 2011

Comment 1:

Maybe we should just delete them.
sort.SortInts etc already exist.

Owner changed to @griesemer.

Status changed to Accepted.

@griesemer
Copy link
Contributor

Comment 2:

Fixed with http://code.google.com/p/go/source/detail?r=cf0c2b126968 by r.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 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
Development

No branches or pull requests

3 participants