learning_go/pkg/mod/github.com/mattn/go-isatty@v0.0.20
a.pivkin 59666d0dd6 wer
2025-09-06 13:02:52 +03:00
..
.github wer 2025-09-06 13:02:52 +03:00
doc.go wer 2025-09-06 13:02:52 +03:00
example_test.go wer 2025-09-06 13:02:52 +03:00
go.mod wer 2025-09-06 13:02:52 +03:00
go.sum wer 2025-09-06 13:02:52 +03:00
go.test.sh wer 2025-09-06 13:02:52 +03:00
isatty_bsd.go wer 2025-09-06 13:02:52 +03:00
isatty_others_test.go wer 2025-09-06 13:02:52 +03:00
isatty_others.go wer 2025-09-06 13:02:52 +03:00
isatty_plan9.go wer 2025-09-06 13:02:52 +03:00
isatty_solaris.go wer 2025-09-06 13:02:52 +03:00
isatty_tcgets.go wer 2025-09-06 13:02:52 +03:00
isatty_windows_test.go wer 2025-09-06 13:02:52 +03:00
isatty_windows.go wer 2025-09-06 13:02:52 +03:00
LICENSE wer 2025-09-06 13:02:52 +03:00
README.md wer 2025-09-06 13:02:52 +03:00

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