Exemplo n.º 1
0
Arquivo: auth.go Projeto: kevbook/hk
func readPassword(prompt string) (password string, err error) {
	if acceptPasswordFromStdin && !term.IsTerminal(os.Stdin) {
		_, err = fmt.Scanln(&password)
		return
	}
	// NOTE: speakeasy may not support multi-byte chars on Windows
	return speakeasy.Ask("Enter password: ")
}
Exemplo n.º 2
0
Arquivo: main.go Projeto: kevbook/hk
func main() {
	password, err := speakeasy.Ask("Please enter a password: "******"Password result: %q\n", password)
	fmt.Printf("Password len: %d\n", len(password))
}