From 8cbea70e072048363b07a5457c6b920378e2cbbb Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 4 Apr 2014 10:04:22 +0800 Subject: [PATCH] beego: hot fix for TestBeegoInit can't parsefile --- beego.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beego.go b/beego.go index 6a727906..439add44 100644 --- a/beego.go +++ b/beego.go @@ -238,6 +238,11 @@ func initBeforeHttpRun() { func TestBeegoInit(apppath string) { AppPath = apppath AppConfigPath = filepath.Join(AppPath, "conf", "app.conf") + err := ParseConfig() + if err != nil && !os.IsNotExist(err) { + // for init if doesn't have app.conf will not panic + Info(err) + } os.Chdir(AppPath) initBeforeHttpRun() }