]> Cypherpunks repositories - gostls13.git/commitdiff
io: define SeekStart, SeekCurrent, SeekEnd constants for use with Seeker
authorEric Lagergren <ericscottlagergren@gmail.com>
Wed, 24 Feb 2016 02:40:42 +0000 (18:40 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 5 Apr 2016 14:07:04 +0000 (14:07 +0000)
Fixes #6885

Change-Id: I6907958186f6a2427da1ad2f6c20bd5d7bf7a3f9
Reviewed-on: https://go-review.googlesource.com/19862
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/io/io.go

index f7f059ff4562211cbb95ca9d666893594056da3f..6e331920521ac2077ddc11d72e0104849e7df0b6 100644 (file)
@@ -16,6 +16,13 @@ import (
        "errors"
 )
 
+// Seek whence values.
+const (
+       SeekStart   = 0 // seek relative to the origin of the file
+       SeekCurrent = 1 // seek relative to the current offset
+       SeekEnd     = 2 // seek relative to the end
+)
+
 // ErrShortWrite means that a write accepted fewer bytes than requested
 // but failed to return an explicit error.
 var ErrShortWrite = errors.New("short write")