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.

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

Source Files

colorable_others.go noncolorable.go

Directories

PathSynopsis
cmd
cmd/colorable
_example
_example/escape-seq
_example/logrus
_example/title
Version
v0.1.12
Published
Nov 23, 2021
Platform
darwin/amd64
Imports
4 packages
Last checked
8 hours ago

Tools for package owners.