mirror of
https://github.com/xiaoqidun/goini.git
synced 2024-12-23 03:28:17 +08:00
automatic parsing after loading
This commit is contained in:
parent
944b2650ed
commit
2658673b6f
2
goini.go
2
goini.go
@ -56,6 +56,7 @@ func (ini *GoINI) String() string {
|
||||
}
|
||||
func (ini *GoINI) SetData(fileData []byte) {
|
||||
ini.data = bytes.TrimSpace(fileData)
|
||||
ini.ParseIni()
|
||||
}
|
||||
func (ini *GoINI) LoadFile(fileName string) error {
|
||||
b, err := ioutil.ReadFile(fileName)
|
||||
@ -63,6 +64,7 @@ func (ini *GoINI) LoadFile(fileName string) error {
|
||||
return err
|
||||
}
|
||||
ini.data = bytes.TrimSpace(b)
|
||||
ini.ParseIni()
|
||||
return nil
|
||||
}
|
||||
func (ini *GoINI) ParseIni() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user