Re: [go-nuts] Write to bufio Scanner from outside os.Stdin

2019-05-29 Thread roger peppe
On Wed, 29 May 2019 at 18:27, Mark Bauermeister wrote: > I'm in the process of writing a text adventure parser. > By default, the parser simply uses Stdin. > > i e > > for { > fmt.Print(">>> ") > > reader := bufio.NewScanner(os.Stdin) > for reader.Scan() { >

[go-nuts] Write to bufio Scanner from outside os.Stdin

2019-05-29 Thread Mark Bauermeister
I'm in the process of writing a text adventure parser. By default, the parser simply uses Stdin. i e for { fmt.Print(">>> ") reader := bufio.NewScanner(os.Stdin) for reader.Scan() { switch reader.Text() { ... ... This is quite convenient. However, I now