diff --git a/beego.go b/beego.go index 7111510e..7b7109d3 100644 --- a/beego.go +++ b/beego.go @@ -376,10 +376,6 @@ 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 fb176660..b8e7d193 100644 --- a/docs.go +++ b/docs.go @@ -8,6 +8,12 @@ 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 == "" {