fix #52
Showing
2 changed files
with
3 additions
and
2 deletions
| ... | @@ -65,6 +65,7 @@ func init() { | ... | @@ -65,6 +65,7 @@ func init() { |
| 65 | EnableGzip = false | 65 | EnableGzip = false |
| 66 | StaticDir["/static"] = "static" | 66 | StaticDir["/static"] = "static" |
| 67 | AppConfigPath = path.Join(AppPath, "conf", "app.conf") | 67 | AppConfigPath = path.Join(AppPath, "conf", "app.conf") |
| 68 | ParseConfig() | ||
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | type App struct { | 71 | type App struct { | ... | ... |
| ... | @@ -75,8 +75,8 @@ func LoadConfig(name string) (*Config, error) { | ... | @@ -75,8 +75,8 @@ func LoadConfig(name string) (*Config, error) { |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | val := bytes.SplitN(line, bEqual, 2) | 77 | val := bytes.SplitN(line, bEqual, 2) |
| 78 | if bytes.HasPrefix(val[1], bDQuote) { | 78 | if bytes.HasPrefix(strings.TrimSpace(string(val[1])), bDQuote) { |
| 79 | val[1] = bytes.Trim(val[1], `"`) | 79 | val[1] = bytes.Trim(strings.TrimSpace(string(val[1])), `"`) |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | key := strings.TrimSpace(string(val[0])) | 82 | key := strings.TrimSpace(string(val[0])) | ... | ... |
-
Please register or sign in to post a comment