Skip to content

kirill-scherba/stable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Make Simple Table from structure

Stable create Simple Table string from struct

GoDoc Go Report Card

Usage

package main

import (
	"fmt" 
	"github.com/kirill-scherba/stable"
)

func main() {

	var a = []struct {
		ID     string
		Name   string
		Num    int
		Status string
		IPv4   string
	}{
		{"ququ-1", "ququ-1_name", 1, "ready", "1.1.1.1"},
		{"ququ-2", "ququ-2_name", 2, "ready", "2.2.2.2"},
	}

	st := new(stable.Stable)
	fmt.Print(st.StructToTable(a) + "\n\n")
}

Run in The Go Playground

License

BSD