安装
go get github.com/zhangboqi/cfmt
使用
package main
import "github.com/zhangboqi/cfmt"
func main(){
// green
cfmt.Gprintln("green")
// red
cfmt.Rprintln("red")
// yellow
cfmt.Yprintln("yellow")
}
自定义方式
package main
import (
"github.com/zhangboqi/cfmt"
)
func main() {
bfmt := cfmt.New(cfmt.CODE_DEFAULT, cfmt.BG_BLACK, cfmt.FG_BLUE)
bfmt.Println("Blue")
}
源码仓库地址:github.com/zhangboqi/cfmt