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

os: Improve File.Seek documentation #6978

bamiaux opened this issue Dec 17, 2013 · 3 comments

os: Improve File.Seek documentation #6978

bamiaux opened this issue Dec 17, 2013 · 3 comments


Copy link

@bamiaux bamiaux commented Dec 17, 2013

Currently, the documentation on os.File.Seek mentions:

Seek sets the offset for the next Read or Write on file to offset, interpreted according
to whence: 0 means relative to the origin of the file, 1 means relative to the current
offset, and 2 means relative to the end.

It leads people to write things like file.Seek(0, 2) which is in my opinion, not that
readable, especially when you don't know where those numbers come from.

I believe it would be better if the following os constants were mentioned instead:
Copy link

@gopherbot gopherbot commented Dec 17, 2013

Comment 1 by islandberry23:

Copy link

@robpike robpike commented Dec 17, 2013

Comment 2:

Status changed to Duplicate.

Merged into issue #6873.

Copy link

@dominikh dominikh commented Dec 17, 2013

Comment 3:

This isn't precisely a duplicate. issue #6873 is concerned with moving the constants
around, this issue merely suggests making the existing ones more visible.
@bamiaux bamiaux added the duplicate label Dec 17, 2013
@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.
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.