output

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Example (Writer_msgs)
w := NewColoredWriter(os.Stdout)

w.Accent("Accent")
w.Primary("Primary")
w.Error("Error")
Output:

Accent
Primary
Error

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	NoticeColor = "\033[1;36m%s\033[0m"
	ErrorColor  = "\033[1;31m%s\033[0m"
	NoColor     = os.Getenv("TERM") == "dumb" ||
		(!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd()))
)

Functions

This section is empty.

Types

type ColoredWriter

type ColoredWriter struct {
	// contains filtered or unexported fields
}

func NewColoredWriter

func NewColoredWriter(writer io.Writer) *ColoredWriter

func (ColoredWriter) Accent

func (w ColoredWriter) Accent(s string)

func (ColoredWriter) Error

func (w ColoredWriter) Error(s string)

func (ColoredWriter) Primary

func (ColoredWriter) Primary(s string)

func (ColoredWriter) Table

func (w ColoredWriter) Table(tab Table)

type Table

type Table interface {
	Header() []string
	Rows() [][]string
}

Jump to

Keyboard shortcuts

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