Buffer stream rewrite
This commit is contained in:
parent
fc170098e9
commit
6f19875d32
|
@ -39,12 +39,12 @@ func (b *Buffer) Next() rune {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Buffer) stream() {
|
func (b *Buffer) stream() {
|
||||||
|
defer close(b.ready)
|
||||||
for {
|
for {
|
||||||
if r, _, err := b.input.ReadRune(); err != nil {
|
if r, _, err := b.input.ReadRune(); err == nil {
|
||||||
close(b.ready)
|
|
||||||
break
|
|
||||||
} else {
|
|
||||||
b.ready <- r
|
b.ready <- r
|
||||||
|
} else {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue