[go-nuts] bufio.NewReader (os.Stdin)

661 views
Skip to first unread message

Thiago Vitor

unread,
Apr 27, 2010, 8:53:47 PM4/27/10
to golang-nuts
Staff wanted someone to explain me in detail these two lines of data
read from the keyboard.

creation: bufio.NewReader (os.Stdin)
thiago, _: = criacao.ReadBytes ('\ n')

Why bufio.NewReader receives a variable and whose parameter (os.Stdin)?

Andrew Gerrand

unread,
Apr 27, 2010, 8:59:03 PM4/27/10
to Thiago Vitor, golang-nuts
os.Stdin is standard input. See: http://en.wikipedia.org/wiki/Standard_streams

As to the use of bufio.NewReader, have you looked at the bufio package
docs? http://golang.org/pkg/bufio/

It is hard to give more specific advice with such a small sample of
code. It would be easier with more context.
Reply all
Reply to author
Forward
0 new messages