avoid panic when len(log) == 0 in colorLog func

This commit is contained in:
slene 2013-08-22 14:54:02 +08:00
parent 467f7a0994
commit 90648d22cd
1 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,10 @@ const (
// Errors have to surrounded by "[ " and " ]"(space).
func colorLog(format string, a ...interface{}) {
log := fmt.Sprintf(format, a...)
if len(log) == 0 {
return
}
if runtime.GOOS != "windows" {
var clog string