packer-cn/vendor/github.com/mattn/go-isatty
Chris Bednarski dbdb988634 Vendor all dependencies 2016-02-04 17:33:36 -08:00
..
LICENSE Vendor all dependencies 2016-02-04 17:33:36 -08:00
README.md Vendor all dependencies 2016-02-04 17:33:36 -08:00
doc.go Vendor all dependencies 2016-02-04 17:33:36 -08:00
isatty_appengine.go Vendor all dependencies 2016-02-04 17:33:36 -08:00
isatty_bsd.go Vendor all dependencies 2016-02-04 17:33:36 -08:00
isatty_linux.go Vendor all dependencies 2016-02-04 17:33:36 -08:00
isatty_solaris.go Vendor all dependencies 2016-02-04 17:33:36 -08:00
isatty_windows.go Vendor all dependencies 2016-02-04 17:33:36 -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)