prysm-pulse/vendor/github.com/mattn/go-isatty
Preston Van Loon a41e372b39 First pass collation
Former-commit-id: fa0dc873367b92a06b10fd989e3fec960c03065a [formerly e98efffa565ea6aa3eadeb19c2f9a66a56eb5ddd]
Former-commit-id: ce6e4f01d12015e67a51aa7d928a6ab8e8eedeee
2018-01-12 22:59:17 -05:00
..
doc.go First pass collation 2018-01-12 22:59:17 -05:00
isatty_appengine.go First pass collation 2018-01-12 22:59:17 -05:00
isatty_bsd.go First pass collation 2018-01-12 22:59:17 -05:00
isatty_linux.go First pass collation 2018-01-12 22:59:17 -05:00
isatty_not_windows.go First pass collation 2018-01-12 22:59:17 -05:00
isatty_solaris.go First pass collation 2018-01-12 22:59:17 -05:00
isatty_windows.go First pass collation 2018-01-12 22:59:17 -05:00
LICENSE First pass collation 2018-01-12 22:59:17 -05:00
README.md First pass collation 2018-01-12 22:59:17 -05:00

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