package printer

Import Path
	go/printer (on and

Dependency Relation
	imports 12 packages, and imported by one package

Involved Source Files
	d-> printer.go

Exported Type Names

type CommentedNode (struct) A CommentedNode bundles an AST node and corresponding comments. It may be provided as argument to any of the Fprint functions. Comments []*ast.CommentGroup // *ast.File, or ast.Expr, ast.Decl, ast.Spec, or ast.Stmt
type Config (struct) A Config node controls the output of Fprint. // default: 0 (all code is indented at least by this much) // default: 0 // default: 8 Fprint "pretty-prints" an AST node to output for a given configuration cfg. Position information is interpreted relative to the file set fset. The node type must be *ast.File, *CommentedNode, []ast.Decl, []ast.Stmt, or assignment-compatible to ast.Expr, ast.Decl, ast.Spec, or ast.Stmt.
type Mode uint A Mode value is a set of flags (or 0). They control printing. const RawFormat const SourcePos const TabIndent const UseSpaces
Exported Values
func Fprint(output io.Writer, fset *token.FileSet, node interface{}) error 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 alignment; use format.Node (package go/format) for output that matches gofmt.
const RawFormat Mode = 1 // do not use a tabwriter; if set, UseSpaces is ignored
const SourcePos Mode = 8 // emit //line directives to preserve original source positions
const TabIndent Mode = 2 // use tabs for indentation independent of UseSpaces
const UseSpaces Mode = 4 // use spaces instead of tabs for alignment