beego:init GlobalDocApi
Showing
2 changed files
with
4 additions
and
6 deletions
| ... | @@ -376,6 +376,10 @@ func initBeforeHttpRun() { | ... | @@ -376,6 +376,10 @@ func initBeforeHttpRun() { |
| 376 | } | 376 | } |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | if EnableDocs { | ||
| 380 | GlobalDocApi = make(map[string]interface{}) | ||
| 381 | } | ||
| 382 | |||
| 379 | middleware.VERSION = VERSION | 383 | middleware.VERSION = VERSION |
| 380 | middleware.AppName = AppName | 384 | middleware.AppName = AppName |
| 381 | middleware.RegisterErrorHandler() | 385 | middleware.RegisterErrorHandler() | ... | ... |
| ... | @@ -8,12 +8,6 @@ import ( | ... | @@ -8,12 +8,6 @@ import ( |
| 8 | 8 | ||
| 9 | var GlobalDocApi map[string]interface{} | 9 | var GlobalDocApi map[string]interface{} |
| 10 | 10 | ||
| 11 | func init() { | ||
| 12 | if EnableDocs { | ||
| 13 | GlobalDocApi = make(map[string]interface{}) | ||
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | func serverDocs(ctx *context.Context) { | 11 | func serverDocs(ctx *context.Context) { |
| 18 | var obj interface{} | 12 | var obj interface{} |
| 19 | if splat := ctx.Input.Param(":splat"); splat == "" { | 13 | if splat := ctx.Input.Param(":splat"); splat == "" { | ... | ... |
-
Please register or sign in to post a comment