我可能过分夸大了这一点,但在GoLang中,是fmt.Print()写到stdout还是我必须使用os.Stdout.Write?
Sim*_*tti 11
是的,它确实.从源代码:
// Print formats using the default formats for its operands and writes to standard output.
// Spaces are added between operands when neither is a string.
// It returns the number of bytes written and any write error encountered.
func Print(a ...interface{}) (n int, err error) {
return Fprint(os.Stdout, a...)
}
Run Code Online (Sandbox Code Playgroud)
os.Stdout 确实代表标准输出流.