I am a little confused with the buffering mode of Stdout, and fmt.Print

If I am not mistaken, it seems that os.Stdout is not line buffered.
In fact, it is not buffered at all, as shown here :


Is the buffering mode of Stdin, Stdout and Stderr documented somewhere ? I
haven't found so far ...

When the output of a Go program is redirected to a file, is there some
block buffering taking place ?

If I want to create a "line buffered" Writer wrapping os.Stdout, f :=
bufio.NewWriter(os.Stdout) is not enough.
I should create a custom Writer type, with a Write(s) method calling
Flush() if s contains '\n', correct ?

You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 5 | next ›
Discussion Overview
groupgolang-nuts @
postedAug 12, '15 at 5:21p
activeAug 12, '15 at 5:59p



site design / logo © 2021 Grokbase