Commit f5f69bba authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

cmd/go: buffer output for go usage

It did tons of write syscalls before:
    https://www.youtube.com/watch?v=t60fhjAqBdw

This is the worst offender. It's not worth fixing all the cases of two
consecutive prints.

Change-Id: I95860ef6a844d89b149528195182b191aad8731b
Reviewed-on: https://go-review.googlesource.com/2371Reviewed-by: default avatarRob Pike <r@golang.org>
parent ea64e578
......@@ -5,6 +5,7 @@
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
......@@ -236,7 +237,9 @@ func capitalize(s string) string {
}
func printUsage(w io.Writer) {
tmpl(w, usageTemplate, commands)
bw := bufio.NewWriter(w)
tmpl(bw, usageTemplate, commands)
bw.Flush()
}
func usage() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment