func unixReadPassword(prompt string) (password string, err error) { binPass, err := readpass.ReadPass(prompt) fmt.Printf("\n") if err == nil { password = string(binPass) } return }
func main() { password, err := readpass.ReadPass("enter password: "******"\n") if err != nil { fmt.Println(err.Error()) } else { fmt.Printf("%d character password read\n", len(password)) } }