1 Commits

Author SHA1 Message Date
9c3d038fcd improved UnreadString 2022-04-19 19:58:38 +02:00

View File

@ -46,8 +46,8 @@ func (r *Reader) UnreadRune() error {
return nil return nil
} }
// UnreadString calls UnreadRune for each rune in str // UnreadString calls UnreadRune for each rune in str + one addtional rune for the separator rune
// The actual runes are irrelevant. // The actual runes in str are irrelevant.
// Only the rune count of str determines the amount of UnreadRune calls. // Only the rune count of str determines the amount of UnreadRune calls.
// The first error occured will be returned immediately. // The first error occured will be returned immediately.
func (r *Reader) UnreadString(str string) error { func (r *Reader) UnreadString(str string) error {
@ -57,7 +57,7 @@ func (r *Reader) UnreadString(str string) error {
return err return err
} }
} }
return nil return r.UnreadRune()
} }
// StringWhile reads runes and calls f for each one. // StringWhile reads runes and calls f for each one.