Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Printer ¶
type Printer interface { // P writes the arguments and a newline with the current indent. // // Spaces are stripped from the end of the line, and only a newline is printed // if the args result in only spaces or no value. P(args ...interface{}) // In indents. In() // Out unindents. Out() }
Printer is a printer.
func NewPrinter ¶
func NewPrinter(writer io.Writer, options ...PrinterOption) Printer
NewPrinter returns a new Printer.
type PrinterOption ¶
type PrinterOption func(*printer)
PrinterOption is an option for a printer.
func PrinterWithErrorRecorder ¶
func PrinterWithErrorRecorder(errorRecorder func(error)) PrinterOption
PrinterWithErrorRecorder returns a new PrinterOption that records errors.
The default is to drop errors.
func PrinterWithIndent ¶
func PrinterWithIndent(indent string) PrinterOption
PrinterWithIndent returns a new PrinterOption that uses the given indent.
The default is two spaces.
Click to show internal directories.
Click to hide internal directories.