From e9f967102c57527cc554ae24ec8a9141a6c8c6c8 Mon Sep 17 00:00:00 2001 From: ysqi Date: Wed, 1 Jun 2016 19:58:35 +0800 Subject: [PATCH] Fixed parese ini file with empty space line --- config/ini.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/ini.go b/config/ini.go index 53bd992d..9371fe61 100644 --- a/config/ini.go +++ b/config/ini.go @@ -86,11 +86,10 @@ func (ini *IniConfig) parseFile(name string) (*IniConfigContainer, error) { if _, ok := err.(*os.PathError); ok { return nil, err } + line = bytes.TrimSpace(line) if bytes.Equal(line, bEmpty) { continue } - line = bytes.TrimSpace(line) - var bComment []byte switch { case bytes.HasPrefix(line, bNumComment):