-
Notifications
You must be signed in to change notification settings - Fork 18k
io: define SeekStart, SeekCurrent, SeekEnd constants for use with Seeker #6885
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
Comments
The actual use cases for seek are more along the lines of skipping bytes in a stream, determining the size of a stream, rewinding a stream to the beginning, going to the end and start using a io.Reader or io.Writer from a specific position. None of these require actual random access and thus still can be supported by compressed streams. |
Could we just duplicate those three "whence" consts into io, with properly cased names? (i.e. @nightlyone |
I like @extemporalgenome's suggestion. Maybe for Go 1.7. |
CL https://golang.org/cl/19862 mentions this issue. |
CL/19862 introduced the same set of constants to the io package. We should steer users away from the os.SEEK* versions and towards the io.Seek* versions. Updates golang#6885 Change-Id: I96ec5be3ec3439e1295c937159dadaf1ebfb2737 Reviewed-on: https://go-review.googlesource.com/21540 Reviewed-by: Brad Fitzpatrick <[email protected]>
CL https://golang.org/cl/23551 mentions this issue. |
The documentation previously used C style enumerations: 0, 1, 2. While this is pretty much universally correct, it does not help a user become aware of the existence of the SeekStart, SeekCurrent, and SeekEnd constants. Thus, we should use them in the documentation to direct people's attention to them. Updates #6885 Change-Id: I44b5e78d41601c68a0a1c96428c853df53981d52 Reviewed-on: https://go-review.googlesource.com/23551 Reviewed-by: Andrew Gerrand <[email protected]>
The text was updated successfully, but these errors were encountered: