1
0
mirror of https://github.com/astaxie/beego.git synced 2025-08-31 00:47:33 +00:00

better format

- add comments for public function
- format import order in admin.go
- better format for NewControllerRegister in router.go
This commit is contained in:
Ying Zou
2018-11-26 23:19:05 +08:00
parent 42ade6aa49
commit fab7c6b6d0
4 changed files with 10 additions and 8 deletions

View File

@@ -133,14 +133,15 @@ type ControllerRegister struct {
// NewControllerRegister returns a new ControllerRegister.
func NewControllerRegister() *ControllerRegister {
cr := &ControllerRegister{
return &ControllerRegister{
routers: make(map[string]*Tree),
policies: make(map[string]*Tree),
pool: sync.Pool{
New: func() interface{} {
return beecontext.NewContext()
},
},
}
cr.pool.New = func() interface{} {
return beecontext.NewContext()
}
return cr
}
// Add controller handler and pattern rules to ControllerRegister.