Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

github.com/404tk/table

Package Overview
Dependencies
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/404tk/table

Source
Go Modules
Version
v0.0.4
Version published
Created
Source

table

Modified from github.com/modood/table.

Installation

$ go get github.com/404tk/table

Quick start

package main

import (
	"github.com/404tk/table"
)

type House struct {
	Name  string `table:"Name"`
	Sigil string
	Motto string
}

func main() {
	hs := []House{
		{"Stark", "direwolf", "Winter is coming"},
		{"Targaryen", "dragon", "Fire and Blood"},
		{"Lannister", "lion", "Hear Me Roar"},
	}

	// Output to stdout
	table.Output(hs)

	// Or just return table string and then do something
	s := table.Table(hs)
	_ = s
}

output:

+-----------+----------+------------------+
|   NAME    |  SIGIL   |      MOTTO       |
+-----------+----------+------------------+
| Stark     | direwolf | Winter is coming |
| Targaryen | dragon   | Fire and Blood   |
| Lannister | lion     | Hear Me Roar     |
+-----------+----------+------------------+

FAQs

Package last updated on 09 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts