Merge branch 'master' of git://github.com/mattn/go-isatty
tree: b139983262ee311d5ec73adbdc92273c62d92b86
  1. _example/
  2. doc.go
  3. isatty_appengine.go
  4. isatty_bsd.go
  5. isatty_linux.go
  6. isatty_solaris.go
  7. isatty_windows.go
  8. LICENSE
  9. README.md
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)