1
0
mirror of https://github.com/Luzifer/repo-template.git synced 2024-09-20 17:42:58 +00:00
repo-template/vendor/github.com/sirupsen/logrus/terminal_check_windows.go
Knut Ahlers afd68ccae4
Update vendored dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-04-15 20:42:26 +02:00

21 lines
297 B
Go

// +build !appengine,!js,windows
package logrus
import (
"io"
"os"
"syscall"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
var mode uint32
err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
return err == nil
default:
return false
}
}