Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

gotable

Go helper to print a table of data to stdout.

Installation

Make sure you have a working Go environment (Go 1.2 or higher is required). See the install instructions.

To install gotable, simply run:

go get github.com/muesli/gotable

To compile it from source:

cd $GOPATH/src/github.com/muesli/gotable
go get -u -v
go build

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

Development

GoDoc Build Status

About

Go helper to print a table of data to stdout

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.