8000 GitHub - kazhuravlev/ptable: Print slice of structs as a table · GitHub
[go: up one dir, main page]

Skip to content
kazhuravlevPublic

About

Print slice of structs as a table

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

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)
}

About

Print slice of structs as a table

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages

0