luet/vendor/github.com/mattn/go-isatty
Ettore Di Giacinto c98f427156 🎨 Introduce contextualized logging
This commit is multi-fold as it also refactors internally context and logger
as interfaces so it is easier to plug luet as a library externally.

Introduces a garbage collector (related to #227) but doesn't handle yet
parallelism.

Closes #265
2021-12-21 21:54:14 +01:00
..
doc.go 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
go.mod 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
go.sum 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
go.test.sh 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
isatty_bsd.go 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
isatty_others.go 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
isatty_plan9.go 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
isatty_solaris.go 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
isatty_tcgets.go 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
isatty_windows.go 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
LICENSE 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01:00
README.md 🎨 Introduce contextualized logging 2021-12-21 21:54:14 +01: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