tests: log value of IsTerminal

Just log the output of IsTerminal in TestTerminal.

$ go test -v -run TestTerminal
=== RUN   TestTerminal
    isatty_others_test.go:13: os.Stdout: true
--- PASS: TestTerminal (0.00s)
PASS
ok  	github.com/mattn/go-isatty	0.160s
$ go test -v -run TestTerminal | cat
=== RUN   TestTerminal
    isatty_others_test.go:13: os.Stdout: false
--- PASS: TestTerminal (0.00s)
PASS
ok  	github.com/mattn/go-isatty	0.203s
1 file changed
tree: 3785147a3c1b339df82200d8198d6096799d0775
  1. .github/
  2. doc.go
  3. example_test.go
  4. go.mod
  5. go.sum
  6. go.test.sh
  7. isatty_bsd.go
  8. isatty_others.go
  9. isatty_others_test.go
  10. isatty_plan9.go
  11. isatty_solaris.go
  12. isatty_tcgets.go
  13. isatty_windows.go
  14. isatty_windows_test.go
  15. LICENSE
  16. README.md
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