delve/vendor/github.com/mattn/go-isatty/README.md
Yasuhiro Matsumoto f6836cbcf1 terminal: Use go-colorable
Add fallback to display colors on Windows.
2016-04-18 12:49:14 -07:00

374 B

go-isatty

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 {
		fmt.Println("Is Not Terminal")
	}
}

Installation

$ go get github.com/mattn/go-isatty

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)