getpasswd functionality in Go?
问题 Situation: I want to get a password entry from the stdin console - without echoing what the user types . Is there something comparable to getpasswd functionality in Go? What I tried: I tried using syscall.Read , but it echoes what is typed. 回答1: you can do this by execing stty -echo to turn off echo and then stty echo after reading in the password to turn it back on 回答2: The following is one of best ways to get it done. First get terminal package by go get golang.org/x/crypto/ssh package main