2019-08-19,beego代码走读,二、请求入口

2019-08-19  本文已影响0人  onmeiei

github.com/astaxie/beego/router.go中找到Router的入口

func Router(rootpath string, c ControllerInterface, mappingMethods ...string) *App {
    BeeApp.Handlers.Add(rootpath, c, mappingMethods...)
    return BeeApp
}

这里有个变长参数的语法。
这个变长参数用的有点莫名其妙啊,莫非理解有误?先不明觉厉吧。

github.com/astaxie/beego/router.go

应该是一个bug?或者特性

Router数据结构

这个地方有优化的空间,可以做一次树压缩。

上一篇 下一篇

猜你喜欢

热点阅读