From 57fdc308e34e7b656585f1b56fb47078e10963c5 Mon Sep 17 00:00:00 2001 From: wulove Date: Thu, 6 Aug 2015 09:36:43 +0800 Subject: [PATCH] =?UTF-8?q?AutoRender=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E7=BC=96=E8=AF=91=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AutoRender为空,Controller.Render()不再执行,故无需编译模版 --- beego.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/beego.go b/beego.go index 60483764..7bcc0740 100644 --- a/beego.go +++ b/beego.go @@ -306,11 +306,13 @@ func initBeforeHttpRun() { } go GlobalSessions.GC() } - - err := BuildTemplate(ViewsPath) - if err != nil { - if RunMode == "dev" { - Warn(err) + + if AutoRender { + err := BuildTemplate(ViewsPath) + if err != nil { + if RunMode == "dev" { + Warn(err) + } } }