I may be overthinking this too much, but in GoLang, does fmt.Print()
write to stdout or do I have to use os.Stdout.Write
?
From the documentation:
Print formats using the default formats for its operands and writes to standard output.
So yep, it writes to stdout.
From the Print documentation: Print formats using the default formats for its operands and writes to standard output.
Yes, it does. From the source code:
// 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...)
}
os.Stdout
indeed represents the standard output stream.