mirror of https://github.com/sirupsen/logrus.git
Merge pull request #289 from 0xE0F/crosscompiling-solaris
Cross compiling for Solaris-like OS
This commit is contained in:
commit
a22723f16e
|
@ -0,0 +1,15 @@
|
|||
// +build solaris
|
||||
|
||||
package logrus
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// IsTerminal returns true if the given file descriptor is a terminal.
|
||||
func IsTerminal() bool {
|
||||
_, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
|
||||
return err == nil
|
||||
}
|
Loading…
Reference in New Issue