diff --git a/beego.go b/beego.go index 7b7109d3..7111510e 100644 --- a/beego.go +++ b/beego.go @@ -376,6 +376,10 @@ func initBeforeHttpRun() { } } + if EnableDocs { + GlobalDocApi = make(map[string]interface{}) + } + middleware.VERSION = VERSION middleware.AppName = AppName middleware.RegisterErrorHandler() diff --git a/docs.go b/docs.go index b8e7d193..fb176660 100644 --- a/docs.go +++ b/docs.go @@ -8,12 +8,6 @@ import ( var GlobalDocApi map[string]interface{} -func init() { - if EnableDocs { - GlobalDocApi = make(map[string]interface{}) - } -} - func serverDocs(ctx *context.Context) { var obj interface{} if splat := ctx.Input.Param(":splat"); splat == "" {