format

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputType

type OutputType string

OutputType represents the type of output, JSON, XML, TSV, etc.

var (
	// JSONFormat tell the printer to print json
	JSONFormat OutputType = "json"
)

type Printable

type Printable interface {
	Print(writer io.Writer, format OutputType) error
}

Printable is an object that can format itself

type Printer

type Printer interface {
	Print(obj interface{}) error
	ErrPrintf(format string, args ...interface{})
}

Printer prints objects

type StdPrinter

type StdPrinter struct {
	Format OutputType
}

StdPrinter is a printer that prints to os.Stdout

func (StdPrinter) ErrPrintf

func (StdPrinter) ErrPrintf(format string, args ...interface{})

ErrPrintf will print a formatted string to os.Stderr

func (StdPrinter) Print

func (stdPrinter StdPrinter) Print(obj interface{}) error

Print prints an object to os.Stdout

Jump to

Keyboard shortcuts

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