open-consul/vendor/github.com/mattn/go-isatty
Chris Piraino 3dd0b59793
Allow users to configure either unstructured or JSON logging (#7130)
* hclog Allow users to choose between unstructured and JSON logging
2020-01-28 17:50:41 -06:00
..
.travis.yml Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
LICENSE
README.md Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
doc.go
go.mod Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
go.sum Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
go.test.sh Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
isatty_bsd.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
isatty_others.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
isatty_plan9.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
isatty_solaris.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
isatty_tcgets.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
isatty_windows.go Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
renovate.json Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06: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