Help us shape the future of Go! Take the 2026 Go Developer Survey

go-term-ansicolor

module
v0.0.0-...-6f81280 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2013 License: MIT

README

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:

  • cdiff/cdiff.go

Install:

$ cd go-term-ansicolor/cdiff
$ go install

Usage:

$ diff -u ./cdiff.go~ ./cdiff.go | cdiff

See also:

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Directories

Path Synopsis
Package colors strings using ANSI escape sequences.
Package colors strings using ANSI escape sequences.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL