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