]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/printer: document that Fprint doesn't match gofmt output
authorRobert Griesemer <gri@golang.org>
Mon, 26 Sep 2016 19:43:21 +0000 (12:43 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 26 Sep 2016 20:31:23 +0000 (20:31 +0000)
Fixes #16963.

Change-Id: Iaadf0da4ee9cc97146c5e6ac2d93de9ae6893880
Reviewed-on: https://go-review.googlesource.com/29790
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/go/printer/printer.go

index a3eaa6638e30e7e18725a25fe24af1d5b4d0ccc8..2390544b6f5d2565d449140a5f92d02ba6d475d4 100644 (file)
@@ -1292,6 +1292,8 @@ func (cfg *Config) Fprint(output io.Writer, fset *token.FileSet, node interface{
 
 // Fprint "pretty-prints" an AST node to output.
 // It calls Config.Fprint with default settings.
+// Note that gofmt uses tabs for indentation but spaces for alignent;
+// use format.Node (package go/format) for output that matches gofmt.
 //
 func Fprint(output io.Writer, fset *token.FileSet, node interface{}) error {
        return (&Config{Tabwidth: 8}).Fprint(output, fset, node)