예제 #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)
	}
}
예제 #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")
}
예제 #3
0
func (cmd *Command) printError(err error) {
	fmt.Fprint(cmd.out, goterm.Color(fmt.Sprintf("ERROR: %s", err), goterm.RED)+"\n")
}