Golang如何实现stdin / stdout / stderr

I did a little program which was able to parse input from command line. It worked well by means of std.in. However, when I looked up the official document for further learning, I found there was too much stuff for me.

var (
   Stdin = NewFile(uintptr(syscall.Stdin), "/dev/stdin")
)

I read the document of func NewFile, type uintpty, Package syscall individually but could not figure out the whole. Also, I did not know the meaning of /dev/stdin, either.

I never learned another static programming language except for go. How could I realize the magic of stdin?

查看全部
duanke6249
duanke6249
2016/08/04 16:54
  • stdin
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复