runes: fix ReadRune() to actually move the cursor

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-29 00:45:52 +00:00
parent 060151a3ac
commit 6e866caa75
+2 -1
View File
@@ -168,7 +168,8 @@ func (b *Reader) ReadRune() (rune, int, error) {
// decode rune
r, l := utf8.DecodeRune(b.buf[b.cursor:])
// step over
b.cursor += l
// and remember for UnreadRune()
b.lastRuneSize = l