status-go/vendor/github.com/mattn/go-isatty
richΛrd 9e0fb30f8d
chore_: bump go-waku (#5150)
2024-05-15 19:15:00 -04:00
..
LICENSE
README.md
doc.go
go.test.sh
isatty_bsd.go chore_: bump go-waku (#5150) 2024-05-15 19:15:00 -04:00
isatty_others.go chore_: bump go-waku (#5150) 2024-05-15 19:15:00 -04:00
isatty_plan9.go
isatty_solaris.go
isatty_tcgets.go chore_: bump go-waku (#5150) 2024-05-15 19:15:00 -04:00
isatty_windows.go

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