Exemple #1
0
func errRatioToString(r float64) string {
	failRatioS := fmt.Sprintf("%0.2f", r*100)
	if r != 0 {
		return goterm.Color(failRatioS, goterm.RED)
	} else {
		return goterm.Color(failRatioS, goterm.GREEN)
	}
}
Exemple #2
0
func (cmd *Command) printOk(message string, params ...interface{}) {
	fmt.Fprintf(cmd.out, goterm.Color(fmt.Sprintf("OK: %s\n", fmt.Sprintf(message, params...)), goterm.GREEN)+"\n")
}
Exemple #3
0
func (cmd *Command) printError(err error) {
	fmt.Fprint(cmd.out, goterm.Color(fmt.Sprintf("ERROR: %s", err), goterm.RED)+"\n")
}