From 490747a8ae3ef1007ba6f13951a9bda43a9b3f6f Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 7 May 2013 23:06:51 +0800 Subject: [PATCH] fix #52 --- beego.go | 1 + config.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/beego.go b/beego.go index 8c5cb10e..2fdfc005 100644 --- a/beego.go +++ b/beego.go @@ -65,6 +65,7 @@ func init() { EnableGzip = false StaticDir["/static"] = "static" AppConfigPath = path.Join(AppPath, "conf", "app.conf") + ParseConfig() } type App struct { diff --git a/config.go b/config.go index f4eca072..174195c3 100644 --- a/config.go +++ b/config.go @@ -75,8 +75,8 @@ func LoadConfig(name string) (*Config, error) { } val := bytes.SplitN(line, bEqual, 2) - if bytes.HasPrefix(val[1], bDQuote) { - val[1] = bytes.Trim(val[1], `"`) + if bytes.HasPrefix(strings.TrimSpace(string(val[1])), bDQuote) { + val[1] = bytes.Trim(strings.TrimSpace(string(val[1])), `"`) } key := strings.TrimSpace(string(val[0]))