1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-13 16:21:03 +00:00

simplify filter.go hooks.go

This commit is contained in:
fud
2015-12-22 10:02:59 +08:00
parent 2ddda59605
commit cd514803a4
2 changed files with 30 additions and 24 deletions

View File

@ -33,12 +33,11 @@ type FilterRouter struct {
// If the request is matched, the values of the URL parameters defined
// by the filter pattern are also returned.
func (f *FilterRouter) ValidRouter(url string, ctx *context.Context) bool {
isok := f.tree.Match(url, ctx)
if isok == nil {
return false
}
if isok, ok := isok.(bool); ok {
return isok
isOk := f.tree.Match(url, ctx)
if isOk != nil {
if b, ok := isOk.(bool); ok {
return b
}
}
return false
}