mirror of
https://github.com/calmh/deprecated_ini.git
synced 2026-07-17 01:15:05 +00:00
Yet another .INI file parser / writer.
- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| ini.go | ||
| ini_test.go | ||
| LICENSE | ||
| README.md | ||
ini
Yet another .INI file parser / writer. Created because the existing ones were either not general enough (allowing easy access to all parts of the original file) or made annoying assumptions about the format. And probably equal parts NIH. You might want to just write your own instead of using this one, you know that's where you'll end up in the end anyhow.
Documentation
http://godoc.org/github.com/calmh/ini
Example
fd, _ := os.Open("foo.ini")
cfg := ini.Parse(fd)
fd.Close()
val := cfg.Get("general", "foo")
cfg.Set("general", "bar", "baz")
fd, _ = os.Create("bar.ini")
err := cfg.Write(fd)
if err != nil {
// ...
}
err = fd.Close()
License
MIT