[go-nuts] Re: Rune-by-rune through a stream

2016-11-06 Thread so . query
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.Re

Re: [go-nuts] Re: Rune-by-rune through a stream

2016-11-06 Thread roger peppe
On 6 November 2016 at 07:29, 'Axel Wagner' via golang-nuts wrote: > You would use a bufio.Scanner: > https://play.golang.org/p/aZ_vrR3eDq bufio.Reader works pretty well too: https://play.golang.org/p/Z0b2GfAs3T > > On Sun, Nov 6, 2016 at 7:23 AM, wrote: >> >> The io package has the RuneReader i

Re: [go-nuts] Re: Rune-by-rune through a stream

2016-11-06 Thread 'Axel Wagner' via golang-nuts
You would use a bufio.Scanner: https://play.golang.org/p/aZ_vrR3eDq On Sun, Nov 6, 2016 at 7:23 AM, wrote: > The io package has the RuneReader interface. > > You can wrap a generic io.Reader in a bufio.Reader > or if you already have a string or byte slice, you can use > strings.Reader or bytes.

[go-nuts] Re: Rune-by-rune through a stream

2016-11-05 Thread mark
The io package has the RuneReader interface. You can wrap a generic io.Reader in a bufio.Reader or if you already have a string or byte slice, you can use strings.Reader or bytes.Reader respectively, to get a RuneReader. On Saturday, November 5, 2016 at 10:40:34 PM UTC-7, so.q...@gmail.com wrote: