console

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Red can be used as Sprintf, where the output it wrapped in escape characters which will render the text red in terminals.
	Red = color.New(color.Bold, color.FgRed).SprintfFunc()
	// Green can be used as Sprintf, where the output it wrapped in escape characters which will render the text green in terminals.
	Green = color.New(color.Bold, color.FgGreen).SprintfFunc()
	// Yellow can be used as Sprintf, where the output it wrapped in escape characters which will render the text yellow in terminals.
	Yellow = color.New(color.Bold, color.FgYellow).SprintfFunc()
)

Functions

func IntToCheckmark

func IntToCheckmark(i int) string

IntToCheckmark returns a string with ansi color instruction characters: a red ✘ if the argument is zero, a green ✔ otherwise.

func StringToCheckmark

func StringToCheckmark(s string) string

StringToCheckmark returns a string with ansi color instruction characters: a red ✘ if the argument is "0", a yellow ? if the argument is "", a green ✔ otherwise.

Types

type Checkmark

type Checkmark string

Checkmark type is a string with some functions attached.

func Btoc added in v1.4.6

func Btoc(b bool) Checkmark

Btoc returns a Checkmark from a boolean, red ✘ if the argument is false, a green ✔ otherwise.

func Itoc

func Itoc(i int) Checkmark

Itoc returns a Checkmark from an int.

func Stoc

func Stoc(s string) Checkmark

Stoc returns a Checkmark from a string.

func (Checkmark) Inverse

func (c Checkmark) Inverse() Checkmark

Inverse returns the opposite of the given Checkmark: a red ✘ if the argument is a green ✔ and vice versa, a yellow ? otherwise.

func (Checkmark) String

func (c Checkmark) String() string

Jump to

Keyboard shortcuts

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