print

package
v0.0.0-...-13c19bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer represents a Go source code generator for translating command-line commands into Go library calls.

func NewPrinter

func NewPrinter(w io.Writer, src string) *Printer

NewPrinter creates a new Printer for emitting Go source code from parsed package functions.

func (*Printer) PrintBody

func (p *Printer) PrintBody()

PrintBody prints Go source code containing all functions defined in the main package.

func (*Printer) PrintHeader

func (p *Printer) PrintHeader(pkgs map[string]*parse.Package)

PrintHeader prints Go source code containing the main package's imports, type definitions, and variable declarations.

func (*Printer) PrintPackage

func (p *Printer) PrintPackage(verbose bool, pkgPath string, pkg *parse.Package)

PrintPackage prints Go source code containing all functions defined in the main package.

func (*Printer) Println

func (p *Printer) Println(str ...string)

Println prints the given lines (with newline appended) to the receiver p's io.Writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL