File: example_test.go

package info (click to toggle)
golang-github-mattn-go-isatty 0.0.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, experimental, sid
  • size: 120 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (10)
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")
	}
}