1
0
mirror of https://github.com/beego/bee.git synced 2024-11-21 23:50:54 +00:00

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

View File

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