fix badges
1 file changed
tree: c6ddfc5fb5dae0b45fe94574e9666401bde4a5ce
  1. _example/
  2. .travis.yml
  3. doc.go
  4. isatty_appengine.go
  5. isatty_bsd.go
  6. isatty_linux.go
  7. isatty_others.go
  8. isatty_others_test.go
  9. isatty_solaris.go
  10. isatty_windows.go
  11. isatty_windows_test.go
  12. LICENSE
  13. README.md
README.md

go-isatty

[![Godoc Reference][godoc-img]][godoc] [![Build Status][ci-img]][ci] [![Coverage][coveralls-img]][coveralls] [![Go Report Card][goreportcard-img]][goreportcard]

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