github.com/jlmeeker/kismatic@v1.10.1-0.20180612190640-57f9005a1f1a/pkg/install/explain/tty.go (about)

     1  package explain
     2  
     3  import (
     4  	"io"
     5  
     6  	isatty "github.com/mattn/go-isatty"
     7  )
     8  
     9  func isTerminal(out io.Writer) bool {
    10  	type fd interface {
    11  		Fd() uintptr
    12  	}
    13  	switch w := out.(type) {
    14  	case fd:
    15  		return isatty.IsTerminal(w.Fd())
    16  	default:
    17  		return false
    18  	}
    19  }