tree: d354d5870b85a20c23e0c2d803dbe7ae223d8cf7 [path history] [tgz]
  1. doc.go
  2. isatty_appengine.go
  3. isatty_bsd.go
  4. isatty_linux.go
  5. isatty_solaris.go
  6. isatty_windows.go
  7. LICENSE
  8. README.md
vendor/github.com/mattn/go-isatty/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)