MCPcopy Index your code
hub / github.com/mattn/go-colorable

github.com/mattn/go-colorable @v0.1.15

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.15 ↗ · + Follow
47 symbols 102 edges 9 files 16 documented · 34% 776 cross-repo links
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

Write
called by 7
colorable_windows.go
NewNonColorable
called by 6
noncolorable.go
atoiWithDefault
called by 6
colorable_windows.go
NewColorable
called by 2
colorable_windows.go
toHSV
called by 2
colorable_windows.go
n256setup
called by 2
colorable_windows.go
NewColorable
called by 2
colorable_others.go
NewColorableStdout
called by 2
colorable_others.go

Shape

Function 28
Struct 8
Method 6
TypeAlias 5

Languages

Go100%

Modules by API surface

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

For agents

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

⬇ download graph artifact