]> Cypherpunks repositories - gostls13.git/commitdiff
io: use SeekStart, SeekCurrent, and SeekEnd in io.Seeker documentation
authorJoe Tsai <joetsai@digital-static.net>
Sat, 28 May 2016 09:14:25 +0000 (02:14 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Sun, 29 May 2016 06:52:45 +0000 (06:52 +0000)
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 <adg@golang.org>
src/io/io.go

index 80398b39973918a43c8a4002a8b9b444fd13e786..19d0ae5addb3b7ba793bcd22f2e25767d37b26aa 100644 (file)
@@ -102,10 +102,12 @@ type Closer interface {
 // Seeker is the interface that wraps the basic Seek method.
 //
 // Seek sets the offset for the next Read or Write to offset,
-// interpreted according to whence: 0 means relative to the start of
-// the file, 1 means relative to the current offset, and 2 means
-// relative to the end. Seek returns the new offset relative to the
-// start of the file and an error, if any.
+// interpreted according to whence:
+// SeekStart means relative to the start of the file,
+// SeekCurrent means relative to the current offset, and
+// SeekEnd means relative to the end.
+// Seek returns the new offset relative to the start of the
+// file and an error, if any.
 //
 // Seeking to an offset before the start of the file is an error.
 // Seeking to any positive offset is legal, but the behavior of subsequent