From 9c3d038fcdf881825f28c071f4058e800a0c7274 Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Tue, 19 Apr 2022 19:58:38 +0200 Subject: [PATCH] improved UnreadString --- reader.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reader.go b/reader.go index 379ff82..c5bfd58 100644 --- a/reader.go +++ b/reader.go @@ -46,8 +46,8 @@ func (r *Reader) UnreadRune() error { return nil } -// UnreadString calls UnreadRune for each rune in str -// The actual runes are irrelevant. +// UnreadString calls UnreadRune for each rune in str + one addtional rune for the separator rune +// The actual runes in str are irrelevant. // Only the rune count of str determines the amount of UnreadRune calls. // The first error occured will be returned immediately. func (r *Reader) UnreadString(str string) error { @@ -57,7 +57,7 @@ func (r *Reader) UnreadString(str string) error { return err } } - return nil + return r.UnreadRune() } // StringWhile reads runes and calls f for each one.