Example #1
0
func getPassword() string {
	password, err := speakeasy.Ask("Password (typing will be hidden): ")
	if err != nil {
		PrintError(err)
	}
	return password
}
Example #2
0
func getPassword(prompt string) string {
	password, err := speakeasy.Ask(prompt)
	if err != nil {
		if err.Error() == "The handle is invalid." {
			Errln(`Login is currently incompatible with git bash/cygwin
In the meantime, login via cmd.exe
https://github.com/heroku/heroku-cli/issues/84`)
			Exit(1)
		} else {
			ExitIfError(err)
		}
	}
	return password
}