commit | 928cf5943fe7c78c85e8026eedcc77d1a7dda799 | [log] [tgz] |
---|---|---|
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | Thu Feb 09 17:05:52 2017 |
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | Thu Feb 09 17:05:52 2017 |
tree | fe75bd9510de675e5a9b391a60afe10a386bd7f8 | |
parent | 4d3696923c876fde8fdea9e7243f602a642d6d5c [diff] |
fixes for review
isatty for golang
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")
}
}
$ go get github.com/mattn/go-isatty
MIT
Yasuhiro Matsumoto (a.k.a mattn)