From b943b74fc5ae829b0605c63b95447e35c34e8ad7 Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 18 Jun 2014 11:09:47 +0800 Subject: [PATCH] beego:init GlobalDocApi --- beego.go | 4 ++++ docs.go | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) 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 == "" {