Go os.Stdin: Pointer to the standard input file

table of Contents

description

Types of

Realization principle


 

description

os.Stdin points to the standard input file /dev/stdin, that is, os.Stdin is a pointer to the standard input file /dev/stdin.

 

Types of

os.Stdin is the pointer type of the File structure of the os package.

*os.File

 

Realization principle

os.Stdin is a variable of the os package. It is the return value of the NewFile function of the os package. The NewFile function returns a pointer to the standard input file /dev/stdin.

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

 

Guess you like

Origin blog.csdn.net/TCatTime/article/details/113408845