Thanks everyone for the examples and suggestions!

I suppose the difference the between bufio.Reader versus bufio.Scanner is 
that Scanner provides specific tokenizing rules/functions designed for 
reading text while Reader is a more general data reader (and as Tamás 
stated adds buffering to io.Reader).



On Saturday, November 5, 2016 at 10:40:34 PM UTC-7, so.q...@gmail.com wrote:
>
> Just a thought experiment, but what's the idiomatic way to read 
> rune-by-rune from a stream that represents a string of infinite length? The 
> stream itself can be from std.In or continually generated by a function.
>
> Would I use bufio.Scanner or bufio.Reader? I suppose its also possible to 
> use a channel.
>
> Also, is it correct for me to say that bufio.Reader is more primitive than 
> bufio.Scanner. Its not clear to me their relative purposes.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to