aboutsummaryrefslogtreecommitdiff
path: root/src/strings
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings')
-rw-r--r--src/strings/reader.go6
-rw-r--r--src/strings/strings_test.go2
2 files changed, 4 insertions, 4 deletions
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")
diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go
index 1ed803bf85..d92dfcc874 100644
--- a/src/strings/strings_test.go
+++ b/src/strings/strings_test.go
@@ -952,7 +952,7 @@ var UnreadRuneErrorTests = []struct {
{"Read", func(r *Reader) { r.Read([]byte{0}) }},
{"ReadByte", func(r *Reader) { r.ReadByte() }},
{"UnreadRune", func(r *Reader) { r.UnreadRune() }},
- {"Seek", func(r *Reader) { r.Seek(0, 1) }},
+ {"Seek", func(r *Reader) { r.Seek(0, io.SeekCurrent) }},
{"WriteTo", func(r *Reader) { r.WriteTo(&bytes.Buffer{}) }},
}