Merge pull request #28 from radeksimko/go-mod

Enable go modules
tree: fb37373aef6abb1301412ea3a989c5bf31555dd9
  1. .travis.yml
  2. doc.go
  3. example_test.go
  4. go.mod
  5. go.sum
  6. isatty_bsd.go
  7. isatty_linux.go
  8. isatty_others.go
  9. isatty_others_test.go
  10. isatty_solaris.go
  11. isatty_windows.go
  12. isatty_windows_test.go
  13. LICENSE
  14. README.md
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