go-term-ansicolor
Go library that colors strings using ANSI escape sequences.
(Go porting from https://github.com/flori/term-ansicolor)
Installation
Using go get
$ go get github.com/koyachi/go-term-ansicolor/ansicolor
After this command go-term-ansicolor is ready to use. its source will be in:
$GOROOT/src/pkg/github.com/koyachi/go-term-ansicolor/ansicolor
You can use go get -u -a for update all installed packages.
Using git clone command:
$ git clone git://github.com/koyachi/go-term-ansicolor
$ cd go-term-ansicolor/ansicolor
$ go install
Example
package main
import (
"fmt"
"github.com/koyachi/go-term-ansicolor/ansicolor"
)
func main() {
fmt.Println(ansicolor.Green("Hello, ") + ansicolor.Red("World!"))
}
Sample Application: cdiff
Source:
Install:
$ cd go-term-ansicolor/cdiff
$ go install
Usage:
$ diff -u ./cdiff.go~ ./cdiff.go | cdiff
See also:
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request