コード例 #1
0
ファイル: main.go プロジェクト: 178inaba/test_base
func exitIfErr(err error) {
	if err != nil {
		fmt.Fprintln(os.Stderr, tint.Colorize(fmt.Sprintf("ERROR: %s", err), tint.Red))
	}
}
コード例 #2
0
func color(old, value string, color int) string {
	return strings.Replace(old, value, tint.Colorize(value, color), 1)
}
コード例 #3
0
ファイル: main.go プロジェクト: 178inaba/test_base
func getMaskedInput(question string) string {
	answer, err := speakeasy.Ask(question + tint.Colorize(" (masked)", tint.LightBlack) + ": ")
	exitIfErr(err)
	return answer
}