Ai
1 Star 0 Fork 0

keke_ys/go-colorable

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
colorable_others.go 639 Bytes
一键复制 编辑 原始数据 按行查看 历史
Yasuhiro Matsumoto 提交于 2017-06-15 11:49 +08:00 . depend on go-isatty
// +build !windows
// +build !appengine
package colorable
import (
"io"
"os"
_ "github.com/mattn/go-isatty"
)
// NewColorable return new instance of Writer which handle escape sequence.
func NewColorable(file *os.File) io.Writer {
if file == nil {
panic("nil passed instead of *os.File to NewColorable()")
}
return file
}
// NewColorableStdout return new instance of Writer which handle escape sequence for stdout.
func NewColorableStdout() io.Writer {
return os.Stdout
}
// NewColorableStderr return new instance of Writer which handle escape sequence for stderr.
func NewColorableStderr() io.Writer {
return os.Stderr
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/keke_ys/go-colorable.git
git@gitee.com:keke_ys/go-colorable.git
keke_ys
go-colorable
go-colorable
v0.1.0

搜索帮助