1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 15:10:49 +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).
func colorLog(format string, a ...interface{}) {
log := fmt.Sprintf(format, a...)
if len(log) == 0 {
return
}
if runtime.GOOS != "windows" {
var clog string