-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
bytes: Reader should use new io.SeekStart, io.SeekCurrent, and io.SeekEnd constants #15269
Labels
Milestone
Comments
Agreed. Will do. |
@bradfitz it was also mentioned in that CL that the comments should probably be reworded to say stream instead of file. (I think Rob said it.) Unsure if that requires its own issue since it's so trivial. s/stream/Reader/ |
You can't seek on a stream. Bikeshed that elsewhere. |
CL https://golang.org/cl/21962 mentions this issue. |
CL https://golang.org/cl/22097 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
May 6, 2016
CL/19862 (f79b50b) recently introduced the constants SeekStart, SeekCurrent, and SeekEnd to the io package. We should use these constants consistently throughout the code base. Updates #15269 Change-Id: If7fcaca7676e4a51f588528f5ced28220d9639a2 Reviewed-on: https://go-review.googlesource.com/22097 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Joe Tsai <joetsai@digital-static.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In acefcb7 three new constants were added for seeking positions in a stream of bytes.
bytes.Reader, strings.Reader, and io.SectionReader currently do not use these constants and instead use 0, 1, and 2.
Since packages bytes and strings (and by default io) all import io, it'd make sense to use those constants internally for their Readers'
Seek
methods.IMO it doesn't make sense to import io into any other packages for the sake of using named constants.
It's a rather trivial issue but it would clarify the source code which iirc was one of the reasons for having defined constants.
The text was updated successfully, but these errors were encountered: