package
module
Version:
v0.0.0-...-5e4e06f
Opens a new window with list of versions in this module.
Published: Oct 31, 2021
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
¶
go-isterminal
Simply check if the passed io.Writer is a attached to a terminal or not.
This lib is a slightly readaptation of what's inside logrus: https://github.com/sirupsen/logrus/blob/master/terminal_check_appengine.go so any credit goes to them. I've just de-tached this part and exposed it publicly as I find it useful in other contexts too.
Usage
import (
terminal "github.com/mudler/go-isterminal"
)
func main() {
if terminal.IsTerminal(os.Stdout) {
....
}
}
Documentation
¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.