From e07d780dcf516de6d573c5bf8e7eee22660a2c00 Mon Sep 17 00:00:00 2001 From: astaxie Date: Mon, 18 Aug 2014 15:00:27 +0800 Subject: [PATCH] update the router info --- router.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/router.go b/router.go index dee96111..a87b7aad 100644 --- a/router.go +++ b/router.go @@ -770,7 +770,11 @@ Admin: if RunMode == "dev" { var devinfo string if findrouter { - devinfo = fmt.Sprintf("| % -10s | % -40s | % -16s | % -10s | % -40s |", r.Method, r.URL.Path, timeend.String(), "match", routerInfo.pattern) + if routerInfo != nil { + devinfo = fmt.Sprintf("| % -10s | % -40s | % -16s | % -10s | % -40s |", r.Method, r.URL.Path, timeend.String(), "match", routerInfo.pattern) + } else { + devinfo = fmt.Sprintf("| % -10s | % -40s | % -16s | % -10s |", r.Method, r.URL.Path, timeend.String(), "match") + } } else { devinfo = fmt.Sprintf("| % -10s | % -40s | % -16s | % -10s |", r.Method, r.URL.Path, timeend.String(), "notmatch") }