Golang go/printer.Fprint() function example

package go/printer

Fprint "pretty-prints" an AST node to output. It calls Config.Fprint with default settings.

Golang go/printer.Fprint() function usage example

 func (f *File) print(w io.Writer) {
 printer.Fprint(w, f.fset, f.astFile)
 }

Reference :

http://golang.org/pkg/go/printer/#Fprint

Advertisement