Skip to content

Commit 0a18561

Browse files
committed
cmd/printer: document that Fprint doesn't match gofmt output
Fixes #16963. Change-Id: Iaadf0da4ee9cc97146c5e6ac2d93de9ae6893880 Reviewed-on: https://go-review.googlesource.com/29790 Reviewed-by: Matthew Dempsky <[email protected]>
1 parent e2e11f0 commit 0a18561

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/go/printer/printer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,8 @@ func (cfg *Config) Fprint(output io.Writer, fset *token.FileSet, node interface{
12921292

12931293
// Fprint "pretty-prints" an AST node to output.
12941294
// It calls Config.Fprint with default settings.
1295+
// Note that gofmt uses tabs for indentation but spaces for alignent;
1296+
// use format.Node (package go/format) for output that matches gofmt.
12951297
//
12961298
func Fprint(output io.Writer, fset *token.FileSet, node interface{}) error {
12971299
return (&Config{Tabwidth: 8}).Fprint(output, fset, node)

0 commit comments

Comments
 (0)