update README.md
1 file changed
tree: 5a713ed93ef2a9eb7e7707509884744df4cfafb7
  1. .travis.yml
  2. LICENSE
  3. README.md
  4. _example/
  5. doc.go
  6. isatty_appengine.go
  7. isatty_bsd.go
  8. isatty_linux.go
  9. isatty_non_windows_test.go
  10. isatty_not_windows.go
  11. isatty_solaris.go
  12. isatty_windows.go
  13. isatty_windows_test.go
README.md

go-isatty

Build Status Coverage Status

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 if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
		fmt.Println("Is Cygwin/MSYS2 Terminal")
	} else {
		fmt.Println("Is Not Terminal")
	}
}

Installation

$ go get github.com/mattn/go-isatty

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

Thanks