mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:50:55 +00:00
Update ini.go
支持BOM格式的ini文件
This commit is contained in:
parent
710f5b6234
commit
180c6aafac
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user