1. 首页
  2. 会员
  3. yougg的信息
初级会员
  • 第 3060 位会员
  • yougg
  • joe006@126.com
  • 2015年06月26日 13:42:27
  • Offline
  • 26 99

最近发布的主题

最近发布的文章

    暂无

最近发布的项目

    暂无

最近的评论

  • 先把 `$GOPATH/bin`加到系统环境变量`PATH`中.
  • 难道Java里面有`struct tag` ?
  • #1 @yougg `main`第一行再加一句 `fmt.Print("Input password:")`
  • 仅限Linux: ```go package main func main() { pwd = new(string) terminalEcho(false) // Hide input fmt.Scanln(pwd) terminalEcho(true) fmt.Println(pwd) } func terminalEcho(show bool) { // Enable or disable echoing terminal input. This is useful specifically for // when users enter passwords. // calling terminalEcho(true) turns on echoing (normal mode) // calling terminalEcho(false) hides terminal input. var termios = &syscall.Termios{} var fd = os.Stdout.Fd() if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, syscall.TCGETS, uintptr(unsafe.Pointer(termios))); err != 0 { return } if show { termios.Lflag |= syscall.ECHO } else { termios.Lflag &^= syscall.ECHO } if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TCSETS), uintptr(unsafe.Pointer(termios))); err != 0 { return } } ```
  • Google Go语言 golang 语法详解笔记 http://yougg.github.io/static/gonote/gogrammar.html