-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Open
Labels
Milestone
Description
The three variables os.Stdin, os.Stdout, and os.Stderr are all *Files, for historical reasons (they predate the io.Writer interface definition).
They should be of type io.Reader and io.Writer, respectively. This would make it easier to do interesting things with special input or output processors. For instance, one could say
os.Stdout = bufio.NewWriter(os.Stdout)
os.Stderr = bufio.NewWriter(os.Stderr)
and all output, including from log.Printf and fmt.Printf, would be buffered. Much more imaginative things would also be possible.
Also, *File is the root of a large dependency tree that simple programs would be able to avoid.
Can't change it now, but we could in Go 2.
musha68k, bcho, leighmcculloch, owais, dvrkps and 84 moretmthrgd, bcmills, mpx and aimjel