table

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(t Table) (string, error)

func MustFormat

func MustFormat(t Table) string

Return the error message as a string

Types

type Header struct {
	Title    string
	MaxWidth int // Max width of the text (not including spacing). Items that are longer will be truncated to less than MaxWidth to fit the ellipses. If 0 is provided, it defaults to no max.
	MinWidth int // Min width of the text (not including spacing)
	Hidden   bool
}

type Table

type Table struct {
	Headers []Header
	Rows    [][]interface{}
	Spacing int // Spacing between rows. If 0 is provided, it defaults to 3.
}

Jump to

Keyboard shortcuts

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