commit | 6ede958d68264787b0bcad4da6061bb4a8795bce | [log] [tgz] |
---|---|---|
author | Tobias Klauser <tklauser@distanz.ch> | Tue Jan 21 17:10:37 2020 |
committer | Tobias Klauser <tklauser@distanz.ch> | Tue Jan 21 17:10:37 2020 |
tree | ea2714c7c433f7a18e94615809201251f9452c22 | |
parent | 27288b1b7adb8e07ab942b8c6e1f9c0df43fa4ab [diff] |
go mod tidy Clean up unused version hashes in go.sum by running `go mod tidy`.
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)
k-takata: base idea for IsCygwinTerminal