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