printer

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Indent

func Indent(depth int) string

Indent indents each depth two spaces " ".

Types

type Printer added in v0.15.0

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

func New added in v0.15.0

func New() *Printer

New creates a new printer.

func (*Printer) Bytes added in v0.15.0

func (p *Printer) Bytes() []byte

Bytes returns the bytes content of printer.

func (*Printer) P added in v0.15.0

func (p *Printer) P(v ...any)

P prints a line to the printer. It converts each parameter to a string following the same rules as fmt.Print. It never inserts spaces between parameters.

func (*Printer) Save added in v0.15.0

func (p *Printer) Save(filename string) error

Save saves the printer content to a file.

func (*Printer) SaveWithGoFormat added in v0.15.0

func (p *Printer) SaveWithGoFormat(filename string) error

SaveWithGoFormat saves the printer content to a file with go format.

func (*Printer) String added in v0.15.0

func (p *Printer) String() string

String returns the string content of printer.

Jump to

Keyboard shortcuts

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