šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

github.com/vegasq/GoPrintTable

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/vegasq/GoPrintTable

v0.0.0-20190927144006-c3e37b84cb9d
Source
Go
Version published
Created
Source

GoPrintTable

Install

For stable release:

go get gopkg.in/vegasq/GoPrintTable.v1

import "gopkg.in/vegasq/GoPrintTable.v1"

For devel release:

go get github.com/vegasq/GoPrintTable

import "github.com/vegasq/GoPrintTable"

Usage

Let's assume we have such structure:

header := []string{"Node Name", "IP", "Status"}
node1 := []string{"controller", "192.168.0.100", "Online"}
node2 := []string{"minion1", "192.168.0.101", "Offline"}
node3 := []string{"minion2", "192.168.0.102"}
t := [][]string{header, node1, node2, node3}

Now let's print it to console with:

GoPrintTable.PrintTableWithHeader(t)

Output will be:

----------------------------------------
| Node Name  | IP            | Status  |
----------------------------------------
| controller | 192.168.0.100 | Online  |
| minion1    | 192.168.0.101 | Offline |
| minion2    | 192.168.0.102 | -       |
----------------------------------------

Or with:

GoPrintTable.PrintTable(t)

Output will be:

----------------------------------------
| Node Name  | IP            | Status  |
| controller | 192.168.0.100 | Online  |
| minion1    | 192.168.0.101 | Offline |
| minion2    | 192.168.0.102 | -       |
----------------------------------------

FAQs

Package last updated on 27 Sep 2019

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