go-colorable – github.com/mattn/go-colorable Index | Files | Directories

package colorable

import "github.com/mattn/go-colorable"

Index

Functions

func EnableColorsStdout

func EnableColorsStdout(enabled *bool) func()

EnableColorsStdout enable colors if possible.

func NewColorable

func NewColorable(file *os.File) io.Writer

NewColorable returns new instance of Writer which handles escape sequence from File.

func NewColorableStderr

func NewColorableStderr() io.Writer

NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.

func NewColorableStdout

func NewColorableStdout() io.Writer

NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.

func NewNonColorable

func NewNonColorable(w io.Writer) io.Writer

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

type Writer

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

Writer provides colorable Writer to the console

func (*Writer) Write

func (w *Writer) Write(data []byte) (n int, err error)

Write writes data on console

Source Files

colorable_windows.go noncolorable.go

Directories

PathSynopsis
cmd
cmd/colorable
_example
_example/escape-seq
_example/logrus
_example/title
Version
v0.0.13
Published
Aug 15, 2022
Platform
windows/amd64
Imports
10 packages
Last checked
6 minutes ago

Tools for package owners.