美文网首页
2019-08-19,beego代码走读,二、请求入口

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

作者: onmeiei | 来源:发表于2019-08-19 09:55 被阅读0次

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数据结构

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

相关文章

网友评论

      本文标题:2019-08-19,beego代码走读,二、请求入口

      本文链接:https://www.haomeiwen.com/subject/phvjsctx.html