table

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

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

Formatter converts Rows into an ASCII table format with space separated columns

func New

func New(headers []string, out io.Writer) *Formatter

New returns a new tabwriter, if headers is not empty it's written as first row to the output

func (*Formatter) Flush

func (f *Formatter) Flush() error

Flush flushes the tabwriter buffer, should be called after all rows were written, otherwise the column width might be incorrect. See tabwriter.Flush() documentation.

func (*Formatter) WriteRow

func (f *Formatter) WriteRow(row ...interface{}) error

WriteRow writes a row to the tabwriter buffer

Jump to

Keyboard shortcuts

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