MCPcopy Create free account
hub / github.com/mattn/go-colorable

github.com/mattn/go-colorable

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.13 ↗ · + Follow · compare 2 versions
49 symbols 100 edges 9 files ⚖ MIT 20 documented · 41% updated 3mo ago★ 8127 open issues

Browse by type

Functions 36 Types & classes 13
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

go-colorable

Build Status Codecov GoDoc Go Report Card

Colorable writer for windows.

For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) This package is possible to handle escape sequence for ansi color on windows.

Too Bad!

So Good!

Usage

logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})
logrus.SetOutput(colorable.NewColorableStdout())

logrus.Info("succeeded")
logrus.Warn("not correct")
logrus.Error("something error")
logrus.Fatal("panic")

You can compile above code on non-windows OSs.

Installation

$ go get github.com/mattn/go-colorable

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 30
Struct 8
Method 6
TypeAlias 5

Languages

Go100%

Modules by API surface

colorable_windows.go27 symbols
colorable_test.go7 symbols
colorable_others.go4 symbols
colorable_appengine.go4 symbols
noncolorable.go3 symbols
cmd/colorable/colorable.go1 symbols
_example/title/main.go1 symbols
_example/logrus/main.go1 symbols
_example/escape-seq/main.go1 symbols

Dependencies from manifests, versioned

For agents

$ claude mcp add go-colorable \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page