Skip to content

muesli/gotable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gotable

Build Status Go ReportCard GoDoc

Go helper to print a table of data to stdout or an io.Writer.

Installation

go get github.com/muesli/gotable

Example

package main

import (
	"github.com/muesli/gotable"
)

func main() {
	tab := gotable.NewTable([]string{"Fruit", "Yumminess", "Color"},
		[]int64{-40, -20, 15},
		"No data in table.")

	tab.AppendRow([]interface{}{"Banana", "very", "yellow"})
	tab.AppendRow([]interface{}{"Pear", "much", "depends"})
	tab.AppendRow([]interface{}{"Pineapple", "delicious", "pineappley"})

	tab.Print()
}

What it looks like

Fruit                                     Yumminess                       Color
-------------------------------------------------------------------------------
Banana                                    very                           yellow
Pear                                      much                          depends
Pineapple                                 delicious                  pineappley

About

Go helper to print a table of data to stdout

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages