File: example_test.go

package info (click to toggle)
golang-github-mattn-go-isatty 0.0.12-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 128 kB
  • sloc: sh: 9; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package isatty_test

import (
	"fmt"
	"os"

	"github.com/mattn/go-isatty"
)

func Example() {
	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")
	}
}