Yet another .INI file parser / writer.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2015-09-02 11:56:45 +02:00
ini.go This package is deprecated 2015-09-02 11:42:58 +02:00
ini_test.go Delete config options 2014-01-29 21:35:26 +01:00
LICENSE LICENSE & README 2013-10-15 12:27:43 +02:00
README.md Deprecated. 2015-09-02 11:56:45 +02:00

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