buf

package
v0.0.0-...-f5ffb6e Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 4 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 is a convenience struct that helps when printing files.

The concept was taken from the golang/protobuf plugin.

func NewPrinter

func NewPrinter(indent string) *Printer

NewPrinter returns a new Printer.

func (*Printer) Bytes

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

Bytes returns the printed bytes.

func (*Printer) In

func (p *Printer) In()

In adds one indent.

func (*Printer) Out

func (p *Printer) Out()

Out deletes one indent.

func (*Printer) P

func (p *Printer) P(args ...interface{})

P prints the args concatenated on the same line after printing the current indent and then prints a newline.

func (*Printer) String

func (p *Printer) String() string

String returns the printed string.

Jump to

Keyboard shortcuts

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