open-nomad/vendor/github.com/mattn/go-isatty
Diptanu Choudhury 9897b600ca Using godeps to build 2016-02-12 10:02:16 -08:00
..
LICENSE Using godeps to build 2016-02-12 10:02:16 -08:00
README.md Using godeps to build 2016-02-12 10:02:16 -08:00
doc.go Using godeps to build 2016-02-12 10:02:16 -08:00
isatty_appengine.go Using godeps to build 2016-02-12 10:02:16 -08:00
isatty_bsd.go Using godeps to build 2016-02-12 10:02:16 -08:00
isatty_linux.go Using godeps to build 2016-02-12 10:02:16 -08:00
isatty_solaris.go Using godeps to build 2016-02-12 10:02:16 -08:00
isatty_windows.go Using godeps to build 2016-02-12 10:02:16 -08:00

README.md

go-isatty

isatty for golang

Usage

package main

import (
	"fmt"
	"github.com/mattn/go-isatty"
	"os"
)

func main() {
	if isatty.IsTerminal(os.Stdout.Fd()) {
		fmt.Println("Is Terminal")
	} else {
		fmt.Println("Is Not Terminal")
	}
}

Installation

$ go get github.com/mattn/go-isatty

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)