package colorable
import "github.com/mattn/go-colorable"
Index ¶
- func EnableColorsStdout(enabled *bool) func()
- func NewColorable(file *os.File) io.Writer
- func NewColorableStderr() io.Writer
- func NewColorableStdout() io.Writer
- func NewNonColorable(w io.Writer) io.Writer
- type NonColorable
Functions ¶
func EnableColorsStdout ¶
func EnableColorsStdout(enabled *bool) func()
EnableColorsStdout enable colors if possible.
func NewColorable ¶
NewColorable returns new instance of Writer which handles escape sequence.
func NewColorableStderr ¶
NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
func NewColorableStdout ¶
NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
func NewNonColorable ¶
NewNonColorable returns new instance of Writer which removes escape sequence from Writer.
Types ¶
type NonColorable ¶
type NonColorable struct {
// contains filtered or unexported fields
}
NonColorable holds writer but removes escape sequence.
func (*NonColorable) Write ¶
func (w *NonColorable) Write(data []byte) (n int, err error)
Write writes data on console
Source Files ¶
colorable_others.go noncolorable.go
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/colorable | |
_example | |
_example/escape-seq | |
_example/logrus | |
_example/title |
- Version
- v0.1.10
- Published
- Sep 25, 2021
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 4 hours ago –
Tools for package owners.