Skip to content

kazhuravlev/ptable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ptable

Simple helper that print the slice of structs as a table.

Installation

go get github.com/kazhuravlev/ptable

Example

package main

import "github.com/kazhuravlev/ptable"

func main() {
	type User struct {
		ID   int
		Name string
		Age  int
	}

	data := []User{
		{ID: 1, Name: "Bob", Age: 42},
		{ID: 2, Name: "Alice", Age: 32},
	}

	ptable.Println(data)
}