1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 08:50:56 +00:00

Fixed parese ini file with empty space line

This commit is contained in:
ysqi 2016-06-01 19:58:35 +08:00
parent 2e0bcf611c
commit e9f967102c

View File

@ -86,11 +86,10 @@ func (ini *IniConfig) parseFile(name string) (*IniConfigContainer, error) {
if _, ok := err.(*os.PathError); ok { if _, ok := err.(*os.PathError); ok {
return nil, err return nil, err
} }
line = bytes.TrimSpace(line)
if bytes.Equal(line, bEmpty) { if bytes.Equal(line, bEmpty) {
continue continue
} }
line = bytes.TrimSpace(line)
var bComment []byte var bComment []byte
switch { switch {
case bytes.HasPrefix(line, bNumComment): case bytes.HasPrefix(line, bNumComment):