1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 08:50:56 +00:00

better comment for color map

This commit is contained in:
JessonChan 2019-03-08 12:10:57 +08:00
parent 4a5e108527
commit 8432a1c758

View File

@ -161,10 +161,12 @@ func initColor() {
cyan = w32Cyan
}
colorMap = map[string]string{
//by color
"green": green,
"white": white,
"yellow": yellow,
"red": red,
//by method
"GET": blue,
"POST": cyan,
"PUT": yellow,
@ -195,13 +197,6 @@ func ColorByStatus(code int) string {
}
// ColorByMethod return color by http code
// GET return Blue
// POST return Cyan
// PUT return Yellow
// DELETE return Red
// PATCH return Green
// HEAD return Magenta
// OPTIONS return WHITE
func ColorByMethod(method string) string {
once.Do(initColor)
if c := colorMap[method]; c != "" {