1 Star 0 Fork 34

lineCodeJm/git-repo-clean

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
color.go 999 Bytes
一键复制 编辑 原始数据 按行查看 历史
Li Linchao 提交于 2022-07-07 17:17 . refact: adjust code struct
package main
import (
"fmt"
colorable "github.com/mattn/go-colorable"
)
const (
FORMAT_RED = "\033[31m%s\033[0m"
FORMAT_GREEN = "\033[32m%s\033[0m"
FORMAT_YELLOW = "\033[33m%s\033[0m"
FORMAT_BLUE = "\033[34m%s\033[0m"
)
var out = colorable.NewColorableStdout()
func PrintRed(msg string) {
fmt.Fprintf(out, FORMAT_RED, msg)
}
func PrintGreen(msg string) {
fmt.Fprintf(out, FORMAT_GREEN, msg)
}
func PrintYellow(msg string) {
fmt.Fprintf(out, FORMAT_YELLOW, msg)
}
func PrintBlue(msg string) {
fmt.Fprintf(out, FORMAT_BLUE, msg)
}
func PrintPlain(msg string) {
fmt.Print(msg)
}
func PrintRedln(msg string) {
fmt.Fprintf(out, FORMAT_RED, msg)
fmt.Println()
}
func PrintGreenln(msg string) {
fmt.Fprintf(out, FORMAT_GREEN, msg)
fmt.Println()
}
func PrintYellowln(msg string) {
fmt.Fprintf(out, FORMAT_YELLOW, msg)
fmt.Println()
}
func PrintBlueln(msg string) {
fmt.Fprintf(out, FORMAT_BLUE, msg)
fmt.Println()
}
func PrintPlainln(msg string) {
fmt.Println(msg)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lineCodeJm/git-repo-clean.git
git@gitee.com:lineCodeJm/git-repo-clean.git
lineCodeJm
git-repo-clean
git-repo-clean
main

搜索帮助