code: func ReadPassword(fd int) ([]byte, error) {
  	var st uint32
  	_, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)
  	if e != 0 {
  		return nil, error(e)
  	}
  	old := st
  
  	st &^= (enableEchoInput)
  	st |= (enableProcessedInput | enableLineInput | enableProcessedOutput)
  	_, _, e = syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(st), 0)
  	if e != 0 {
  		return nil, error(e)
  	}
  
  	defer func() {
  		syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(fd), uintptr(old), 0)
  	}()
  
  	var buf [16]byte
  	var ret []byte
  	for {
  		n, err := syscall.Read(syscall.Handle(fd), buf[:])
  		if err != nil {
  			return nil, err
  		}
  		if n == 0 {
  			if len(ret) == 0 {
  				return nil, io.EOF
  			}
  			break
  		}
  		if buf[n-1] == '\n' {
  			n--
  		}
  		if n > 0 && buf[n-1] == '\r' {
  			n--
  		}
  		ret = append(ret, buf[:n]...)
  		if n < len(buf) {
  			break
  		}
  	}
  
  	return ret, nil
  }
docs: // ReadPassword reads a line of input from a terminal without local echo.  This
  // is commonly used for inputting passwords and other sensitive data. The slice
  // returned does not include the \n.