code: func IsTerminal(fd int) bool {
  	var st uint32
  	r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)
  	return r != 0 && e == 0
  }
docs: // IsTerminal returns true if the given file descriptor is a terminal.