go-tty Simple package provides check output device using cgo; Usage if tty.IsTTY() { // doSomething() } Test $ go test Installation $ go get github.com/NovelCorpse/go-tty License GPL-3.0