background/vendor/github.com/mattn/go-isatty
18650180552 b133067a85 添加注册验证码接口 2019-01-31 16:57:22 +08:00
..
LICENSE 添加vendor 2019-01-28 11:19:49 +08:00
README.md 添加vendor 2019-01-28 11:19:49 +08:00
doc.go 添加vendor 2019-01-28 11:19:49 +08:00
isatty_bsd.go 添加注册验证码接口 2019-01-31 16:57:22 +08:00
isatty_linux.go 添加注册验证码接口 2019-01-31 16:57:22 +08:00
isatty_linux_ppc64x.go 添加注册验证码接口 2019-01-31 16:57:22 +08:00
isatty_others.go 添加注册验证码接口 2019-01-31 16:57:22 +08:00
isatty_solaris.go 添加注册验证码接口 2019-01-31 16:57:22 +08:00
isatty_windows.go 添加vendor 2019-01-28 11:19:49 +08:00

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