From 549a39c4787afe9ab377d3373a271f94da3ba33a Mon Sep 17 00:00:00 2001 From: youngsterxyf Date: Mon, 14 Mar 2016 11:26:26 +0800 Subject: [PATCH] fix issue1789: when testing, load config explicitly and forcibly --- beego.go | 1 + config.go | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/beego.go b/beego.go index 8f82cdcf..a6074d22 100644 --- a/beego.go +++ b/beego.go @@ -87,5 +87,6 @@ func TestBeegoInit(ap string) { os.Setenv("BEEGO_RUNMODE", "test") appConfigPath = filepath.Join(ap, "conf", "app.conf") os.Chdir(ap) + LoadAppConfig(appConfigProvider, appConfigPath) initBeforeHTTPRun() } diff --git a/config.go b/config.go index 2761e7cb..0d4df95c 100644 --- a/config.go +++ b/config.go @@ -316,10 +316,6 @@ func LoadAppConfig(adapterName, configPath string) error { return fmt.Errorf("the target config file: %s don't exist", configPath) } - if absConfigPath == appConfigPath { - return nil - } - appConfigPath = absConfigPath appConfigProvider = adapterName