The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/vendor/github.com/mattn/go-isatty
Marcus Efraimsson c12245bbb3
Backend plugins: Updates due to changes in SDK (#22649)
5 years ago
..
LICENSE tech(build): move dependencies to vendor folder 9 years ago
README.md Backend plugins: Updates due to changes in SDK (#22649) 5 years ago
doc.go tech(build): move dependencies to vendor folder 9 years ago
go.mod Backend plugins: Updates due to changes in SDK (#22649) 5 years ago
go.sum Backend plugins: Updates due to changes in SDK (#22649) 5 years ago
go.test.sh Backend plugins: Updates due to changes in SDK (#22649) 5 years ago
isatty_bsd.go Backend plugins: Updates due to changes in SDK (#22649) 5 years ago
isatty_others.go transform: changes to support sdk v0.2.0 (#20426) 6 years ago
isatty_plan9.go Backend plugins: Updates due to changes in SDK (#22649) 5 years ago
isatty_solaris.go replace dep with go modules (#16017) 6 years ago
isatty_tcgets.go Backend plugins: Updates due to changes in SDK (#22649) 5 years ago
isatty_windows.go transform: changes to support sdk v0.2.0 (#20426) 6 years ago
renovate.json Backend plugins: Updates due to changes in SDK (#22649) 5 years ago

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