summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Lagergren <ericscottlagergren@gmail.com>2016-02-23 18:40:42 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2016-04-05 14:07:04 +0000
commitacefcb732cae4daa59a621cb102793860b564a12 (patch)
tree4065f3f79de1adffce3a01fd1d14adea2c3b0609
parent1747788c5668e76a238221ae4982daa5bdf24939 (diff)
downloadgo-git-acefcb732cae4daa59a621cb102793860b564a12.tar.gz
io: define SeekStart, SeekCurrent, SeekEnd constants for use with Seeker
Fixes #6885 Change-Id: I6907958186f6a2427da1ad2f6c20bd5d7bf7a3f9 Reviewed-on: https://go-review.googlesource.com/19862 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--src/io/io.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/io/io.go b/src/io/io.go
index f7f059ff45..6e33192052 100644
--- a/src/io/io.go
+++ b/src/io/io.go
@@ -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")