1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-16 17:20:55 +00:00

Merge pull request #880 from chenghuama/patch-3

Update ini.go
This commit is contained in:
astaxie 2014-10-24 14:15:49 +08:00
commit 9c0aad06c5

View File

@ -66,6 +66,12 @@ func (ini *IniConfig) Parse(name string) (ConfigContainer, error) {
var comment bytes.Buffer
buf := bufio.NewReader(file)
head, err := buf.Peek(3)
if err == nil && head[0] == 239 && head[1] == 187 && head[2] == 191 {
for i := 1; i <= 3; i++ {
buf.ReadByte()
}
}
section := DEFAULT_SECTION
for {
line, _, err := buf.ReadLine()