aboutsummaryrefslogtreecommitdiff
path: root/src/strings/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings/reader.go')
-rw-r--r--src/strings/reader.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/strings/reader.go b/src/strings/reader.go
index 248e55245c..737873c099 100644
--- a/src/strings/reader.go
+++ b/src/strings/reader.go
@@ -145,6 +145,9 @@ func (r *Reader) WriteTo(w io.Writer) (n int64, err error) {
return
}
+// Reset resets the Reader to be reading from s.
+func (r *Reader) Reset(s string) { *r = Reader{s, 0, -1} }
+
// NewReader returns a new Reader reading from s.
// It is similar to bytes.NewBufferString but more efficient and read-only.
func NewReader(s string) *Reader { return &Reader{s, 0, -1} }