Documentation
¶
Index ¶
- Constants
- type IOStreams
- func (s *IOStreams) ColorEnabled() bool
- func (s *IOStreams) ColorFunc(color string) func(string) string
- func (s *IOStreams) Error(format string, a ...interface{})
- func (s *IOStreams) Info(format string, a ...interface{})
- func (s *IOStreams) Is256ColorEnabled() bool
- func (s *IOStreams) IsStderrTTY() bool
- func (s *IOStreams) IsStdinTTY() bool
- func (s *IOStreams) IsStdoutTTY() bool
- func (s *IOStreams) Success(format string, a ...interface{})
- func (s *IOStreams) TerminalWidth() int
- func (s *IOStreams) Warning(format string, a ...interface{})
Constants ¶
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BoldRed = "\033[1;31m" BoldGreen = "\033[1;32m" BoldYellow = "\033[1;33m" BoldBlue = "\033[1;34m" )
Color codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IOStreams ¶
type IOStreams struct {
In io.Reader
Out io.Writer
ErrOut io.Writer
// contains filtered or unexported fields
}
IOStreams provides access to standard input/output streams
func (*IOStreams) ColorEnabled ¶
ColorEnabled returns true if color output is enabled
func (*IOStreams) ColorFunc ¶
ColorFunc returns a function that wraps text in color codes if color is enabled
func (*IOStreams) Is256ColorEnabled ¶
Is256ColorEnabled returns true if 256-color output is enabled
func (*IOStreams) IsStderrTTY ¶
IsStderrTTY returns true if stderr is a terminal
func (*IOStreams) IsStdinTTY ¶
IsStdinTTY returns true if stdin is a terminal
func (*IOStreams) IsStdoutTTY ¶
IsStdoutTTY returns true if stdout is a terminal
func (*IOStreams) TerminalWidth ¶
TerminalWidth returns the width of the terminal, or 80 if not a terminal
Click to show internal directories.
Click to hide internal directories.