Help us shape the future of Go! Take the 2026 Go Developer Survey

output

package
v0.3.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(format string, args ...interface{})

Error prints an error message

func Info

func Info(format string, args ...interface{})

Info prints an info message

func JSON

func JSON(data interface{}) error

JSON outputs data as JSON

func Print

func Print(headers []string, rows [][]string, jsonData interface{}) error

Print outputs data in the current format

func PrintSimple

func PrintSimple(headers []string, rows [][]string) error

PrintSimple prints rows in a simple tab-separated format

func PrintSingle

func PrintSingle(fields map[string]string, jsonData interface{}) error

PrintSingle prints a single item's details in a key:value layout. Keys are sorted alphabetically for deterministic output.

func SetFormat

func SetFormat(f string)

SetFormat sets the global output format

func Success

func Success(format string, args ...interface{})

Success prints a success message

func Table

func Table(headers []string) *tablewriter.Table

Table creates a new table writer with standard styling

func Truncate

func Truncate(s string, max int) string

Truncate truncates a string to a maximum length

func Writer

func Writer() io.Writer

Writer returns the appropriate writer

Types

type Format

type Format string

Format represents the output format

const (
	FormatTable Format = "table"
	FormatJSON  Format = "json"
	FormatCSV   Format = "csv"
)
var CurrentFormat Format = FormatTable

CurrentFormat holds the global output format setting

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL