mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 19:41:00 +00:00
Merge pull request #3417 from xpzouying/update_code_format
better format
This commit is contained in:
commit
d5fd5cad38
3
admin.go
3
admin.go
@ -20,11 +20,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"reflect"
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"reflect"
|
|
||||||
|
|
||||||
"github.com/astaxie/beego/grace"
|
"github.com/astaxie/beego/grace"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/astaxie/beego/toolbox"
|
"github.com/astaxie/beego/toolbox"
|
||||||
|
2
hooks.go
2
hooks.go
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/astaxie/beego/session"
|
"github.com/astaxie/beego/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
//
|
// register MIME type with content type
|
||||||
func registerMime() error {
|
func registerMime() error {
|
||||||
for k, v := range mimemaps {
|
for k, v := range mimemaps {
|
||||||
mime.AddExtensionType(k, v)
|
mime.AddExtensionType(k, v)
|
||||||
|
@ -133,14 +133,15 @@ type ControllerRegister struct {
|
|||||||
|
|
||||||
// NewControllerRegister returns a new ControllerRegister.
|
// NewControllerRegister returns a new ControllerRegister.
|
||||||
func NewControllerRegister() *ControllerRegister {
|
func NewControllerRegister() *ControllerRegister {
|
||||||
cr := &ControllerRegister{
|
return &ControllerRegister{
|
||||||
routers: make(map[string]*Tree),
|
routers: make(map[string]*Tree),
|
||||||
policies: make(map[string]*Tree),
|
policies: make(map[string]*Tree),
|
||||||
}
|
pool: sync.Pool{
|
||||||
cr.pool.New = func() interface{} {
|
New: func() interface{} {
|
||||||
return beecontext.NewContext()
|
return beecontext.NewContext()
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
return cr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add controller handler and pattern rules to ControllerRegister.
|
// Add controller handler and pattern rules to ControllerRegister.
|
||||||
|
@ -361,6 +361,8 @@ type templateFSFunc func() http.FileSystem
|
|||||||
func defaultFSFunc() http.FileSystem {
|
func defaultFSFunc() http.FileSystem {
|
||||||
return FileSystem{}
|
return FileSystem{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetTemplateFSFunc set default filesystem function
|
||||||
func SetTemplateFSFunc(fnt templateFSFunc) {
|
func SetTemplateFSFunc(fnt templateFSFunc) {
|
||||||
beeTemplateFS = fnt
|
beeTemplateFS = fnt
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user