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.