This is a Go package to interact with arbitrary INI
Our applications have a lot of memory data which are key/value pairs in the form of various separators NOT only '\n'. I have not found any golang open source code suitable for it. So I write it myself.
import github.com/zieckey/goini
The simplest example code is :
import github.com/zieckey/goini
ini := goini.New()
err := ini.ParseFile(filename)
if err != nil {
fmt.Printf("parse INI file %v failed : %v\n", filename, err.Error())
return
}
v, ok := ini.Get("the-key")
//...
raw := []byte("a:av|b:bv||c:cv|||d:dv||||||")
ini := goini.New()
err := ini.Parse(raw, "|", ":")
if err != nil {
fmt.Printf("parse INI memory data failed : %v\n", err.Error())
return
}
v, ok := ini.Get("a")
//...