Skip to content

Commit b859a78

Browse files
committed
io: use SeekStart, SeekCurrent, and SeekEnd in io.Seeker documentation
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]>
1 parent 4969b46 commit b859a78

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/io/io.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ type Closer interface {
102102
// Seeker is the interface that wraps the basic Seek method.
103103
//
104104
// Seek sets the offset for the next Read or Write to offset,
105-
// interpreted according to whence: 0 means relative to the start of
106-
// the file, 1 means relative to the current offset, and 2 means
107-
// relative to the end. Seek returns the new offset relative to the
108-
// start of the file and an error, if any.
105+
// interpreted according to whence:
106+
// SeekStart means relative to the start of the file,
107+
// SeekCurrent means relative to the current offset, and
108+
// SeekEnd means relative to the end.
109+
// Seek returns the new offset relative to the start of the
110+
// file and an error, if any.
109111
//
110112
// Seeking to an offset before the start of the file is an error.
111113
// Seeking to any positive offset is legal, but the behavior of subsequent

0 commit comments

Comments
 (0)