status-go/vendor/github.com/mattn/go-isatty
Andrea Maria Piana 4d15ae8a85 Upgrade to go 1.18 2022-05-11 12:39:54 +01:00
..
LICENSE Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
README.md chore: bump go-waku (#2404) 2021-10-19 09:43:41 -04:00
doc.go Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
go.test.sh chore: bump go-waku (#2404) 2021-10-19 09:43:41 -04:00
isatty_bsd.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
isatty_others.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
isatty_plan9.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
isatty_solaris.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
isatty_tcgets.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
isatty_windows.go chore: bump go-waku 2022-04-06 10:36:06 -04:00

README.md

go-isatty

Godoc Reference Codecov 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