open-consul/vendor/github.com/mattn/go-isatty
James Phillips 33ea18fb21
Updates mattn/go-isatty and mitchellh/cli.
2016-08-09 17:26:11 -07:00
..
LICENSE Manage dependencies via Godep 2016-02-12 16:50:37 -08:00
README.md Manage dependencies via Godep 2016-02-12 16:50:37 -08:00
doc.go Manage dependencies via Godep 2016-02-12 16:50:37 -08:00
isatty_appengine.go Manage dependencies via Godep 2016-02-12 16:50:37 -08:00
isatty_bsd.go Updates mattn/go-isatty and mitchellh/cli. 2016-08-09 17:26:11 -07:00
isatty_linux.go Manage dependencies via Godep 2016-02-12 16:50:37 -08:00
isatty_solaris.go Manage dependencies via Godep 2016-02-12 16:50:37 -08:00
isatty_windows.go Manage dependencies via Godep 2016-02-12 16:50:37 -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)