learning_go/pkg/mod/github.com/mattn/go-isatty@v0.0.20/example_test.go
a.pivkin 59666d0dd6 wer
2025-09-06 13:02:52 +03:00

19 lines
306 B
Go

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")
}
}