tree: 19a02cbebe948cf30ce5379a2962625e0e96d753 [path history] [tgz]
  1. LICENSE
  2. README.md
  3. README_CN.md
  4. color-test.go
  5. color.go
  6. showcase.jpg
vendor/github.com/bclicn/color/README.md

GoLang Colorized Output

GoLang colorized output library for Mac & Linux Shell, 中文版说明

Showcase

img

Install

  1. Make sure your've read GoLang Official File Structure
  2. Make sure you've set a correct GOPATH
  3. $ go get github.com/bclicn/color
  4. In your script, import "github.com/bclicn/color" then call color.Test()
  5. Use fmt.Println("Hello" + color.Red("World")) to assemble a colorized output
  6. API examples available in color-test.go

Quick (brainless) Usage

  1. Download color.go
  2. Modify its package color to package main
  3. Put your script under the same directory and write fmt.Println(Red("I'm red !!!"))
  4. Run go run color.go yourScript.go
  5. Or build by go build color.go yourScript.go

A simple test script

package main

import (
    "fmt"
    "github.com/bclicn/color"
)

func main(){
    fmt.Println(color.Red("Red output"))
    color.Test()
}

License

MIT

bcli, 2018-7-11