Carl Bergquist 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
..
LICENSE 6253476c73 tech(build): move dependencies to vendor folder %!s(int64=9) %!d(string=hai) anos
README.md 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
doc.go 6253476c73 tech(build): move dependencies to vendor folder %!s(int64=9) %!d(string=hai) anos
go.mod 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
go.sum 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
isatty_android.go 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
isatty_bsd.go 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
isatty_linux.go 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
isatty_others.go 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
isatty_solaris.go 68f5ddf18c replace dep with go modules (#16017) %!s(int64=6) %!d(string=hai) anos
isatty_windows.go 93ac6680ab update log15 (#9622) %!s(int64=8) %!d(string=hai) anos

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