code: func IsTerminal(w io.Writer) bool {
  	fw, ok := w.(interface {
  		Fd() uintptr
  	})
  	if !ok {
  		return false
  	}
  	var st uint32
  	r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fw.Fd(), uintptr(unsafe.Pointer(&st)), 0)
  	return r != 0 && e == 0
  }
docs: // IsTerminal returns true if w writes to a terminal.