Exemplo n.º 1
0
func exitIfErr(err error) {
	if err != nil {
		fmt.Fprintln(os.Stderr, tint.Colorize(fmt.Sprintf("ERROR: %s", err), tint.Red))
	}
}
Exemplo n.º 2
0
func color(old, value string, color int) string {
	return strings.Replace(old, value, tint.Colorize(value, color), 1)
}
Exemplo n.º 3
0
func getMaskedInput(question string) string {
	answer, err := speakeasy.Ask(question + tint.Colorize(" (masked)", tint.LightBlack) + ": ")
	exitIfErr(err)
	return answer
}