From acc757f678a42ba1ffbf8bb9886de4fe080302de Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Tue, 5 Apr 2016 11:22:53 -0700 Subject: all: use SeekStart, SeekCurrent, SeekEnd CL/19862 (f79b50b8d5bc159561c1dcf7c17e2a0db96a9a11) recently introduced the constants SeekStart, SeekCurrent, and SeekEnd to the io package. We should use these constants consistently throughout the code base. Updates #15269 Change-Id: If7fcaca7676e4a51f588528f5ced28220d9639a2 Reviewed-on: https://go-review.googlesource.com/22097 Reviewed-by: Brad Fitzpatrick Run-TryBot: Joe Tsai TryBot-Result: Gobot Gobot --- src/strings/reader.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/strings/reader.go') diff --git a/src/strings/reader.go b/src/strings/reader.go index e254837c63..6c1a5064c0 100644 --- a/src/strings/reader.go +++ b/src/strings/reader.go @@ -107,11 +107,11 @@ func (r *Reader) Seek(offset int64, whence int) (int64, error) { r.prevRune = -1 var abs int64 switch whence { - case 0: + case io.SeekStart: abs = offset - case 1: + case io.SeekCurrent: abs = r.i + offset - case 2: + case io.SeekEnd: abs = int64(len(r.s)) + offset default: return 0, errors.New("strings.Reader.Seek: invalid whence") -- cgit v1.3