...

Source file src/github.com/mattn/go-isatty/example_test.go

Documentation: github.com/mattn/go-isatty

     1  package isatty_test
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  
     7  	"github.com/mattn/go-isatty"
     8  )
     9  
    10  func Example() {
    11  	if isatty.IsTerminal(os.Stdout.Fd()) {
    12  		fmt.Println("Is Terminal")
    13  	} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
    14  		fmt.Println("Is Cygwin/MSYS2 Terminal")
    15  	} else {
    16  		fmt.Println("Is Not Terminal")
    17  	}
    18  }
    19  

View as plain text