Update GitHub Actions to latest versions - actions/checkout v2 -> v6 - actions/setup-go v2 -> v6 - codecov/codecov-action v2 -> v6 - Go test matrix: 1.17-1.20 -> 1.21-1.23 (match go.mod minimum) - Move checkout before setup-go
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