printer

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LengthForRune

func LengthForRune(r rune) int

LengthForRune gets char length for a rune. All control chars are treated as zero-length.

func LengthForString

func LengthForString(str string) int

LengthForString gets length for a string.

func MaxWidthForLines

func MaxWidthForLines(str string) int

MaxWidthForLines gets max line width for a multi-lines string.

Types

type Table

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

Table prints a table for lines.

func NewTable

func NewTable(maxColWidth int) *Table

NewTable creates a table printer.

func (*Table) AddRow

func (p *Table) AddRow(values ...interface{})

AddRow adds a line to current table.

func (*Table) String

func (p *Table) String() string

String returns table string.

Jump to

Keyboard shortcuts

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