mirror of
https://github.com/beego/bee.git
synced 2024-11-22 05:00:54 +00:00
avoid panic when len(log) == 0 in colorLog func
This commit is contained in:
parent
467f7a0994
commit
90648d22cd
4
util.go
4
util.go
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user