ceph-csi/vendor/github.com/mattn/go-isatty
Niels de Vos f080b9e0c9 rebase: update k8s.io packages to v0.29.0
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-12-21 13:34:39 +00:00
..
doc.go rebase: vendor dependencies for Vault API 2020-11-29 04:03:59 +00:00
go.test.sh rebase: vendor dependencies for Vault API 2020-11-29 04:03:59 +00:00
isatty_bsd.go rebase: update k8s.io packages to v0.29.0 2023-12-21 13:34:39 +00:00
isatty_others.go rebase: vendor files required for kmip 2022-08-18 07:41:42 +00:00
isatty_plan9.go rebase: vendor files required for kmip 2022-08-18 07:41:42 +00:00
isatty_solaris.go rebase: vendor files required for kmip 2022-08-18 07:41:42 +00:00
isatty_tcgets.go rebase: vendor files required for kmip 2022-08-18 07:41:42 +00:00
isatty_windows.go rebase: vendor files required for kmip 2022-08-18 07:41:42 +00:00
LICENSE rebase: vendor dependencies for Vault API 2020-11-29 04:03:59 +00:00
README.md rebase: vendor dependencies for Vault API 2020-11-29 04:03:59 +00:00

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