]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: log node printing error
authorRobert Griesemer <gri@golang.org>
Mon, 23 Jan 2012 03:36:34 +0000 (19:36 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 23 Jan 2012 03:36:34 +0000 (19:36 -0800)
Invaluable when changing template files.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5571044

src/cmd/godoc/godoc.go

index 06da96b0fb66b9a51d794bfd8a86400ba6f8f78b..86983fbe17d18b8342aaff58a19364aed9693627 100644 (file)
@@ -378,7 +378,10 @@ func writeNode(w io.Writer, fset *token.FileSet, x interface{}) {
        //           with an another printer mode (which is more efficiently
        //           implemented in the printer than here with another layer)
        mode := printer.TabIndent | printer.UseSpaces
-       (&printer.Config{mode, *tabwidth}).Fprint(&tconv{output: w}, fset, x)
+       err := (&printer.Config{mode, *tabwidth}).Fprint(&tconv{output: w}, fset, x)
+       if err != nil {
+               log.Print(err)
+       }
 }
 
 func filenameFunc(path string) string {