tree: 4ef7a1f44440ede5d0a93d8edf7d89d3a75f0e5a [path history] [tgz]
  1. doc.go
  2. isatty_bsd.go
  3. isatty_linux.go
  4. isatty_windows.go
  5. LICENSE
  6. README.google
  7. README.md
go/src/github.com/mattn/go-isatty/README.md

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)