fix godoc
1 file changed
tree: af10e4fcab16e40499a49874782008b3f50928a5
  1. .travis.yml
  2. LICENSE
  3. README.md
  4. doc.go
  5. example_test.go
  6. isatty_appengine.go
  7. isatty_bsd.go
  8. isatty_linux.go
  9. isatty_linux_ppc64x.go
  10. isatty_others.go
  11. isatty_others_test.go
  12. isatty_solaris.go
  13. isatty_windows.go
  14. isatty_windows_test.go
README.md

go-isatty

Godoc Reference Build Status Coverage Status Go Report Card

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