simplifying if-else chains to switches (#6208)

This commit is contained in:
Oleg Kovalov
2018-08-06 19:26:40 +02:00
committed by kannappanr
parent a82500f162
commit 37de2dbd3b
14 changed files with 120 additions and 138 deletions

View File

@@ -94,13 +94,14 @@ type Console interface {
}
func consoleLog(console Console, msg string, args ...interface{}) {
if jsonFlag {
switch {
case jsonFlag:
// Strip escape control characters from json message
msg = ansiRE.ReplaceAllLiteralString(msg, "")
console.json(msg, args...)
} else if quiet {
case quiet:
console.quiet(msg, args...)
} else {
default:
console.pretty(msg, args...)
}
}