finds.dev← search

// the find

unknwon/goconfig

★ 604 · Go · Apache-2.0 · updated Sep 2024

Package goconfig is a fully functional and comments-support configuration file (.ini) parser.

goconfig is a Go INI file parser that supports reading and writing comments alongside key/value pairs, which most of the alternatives drop on save. It's aimed at anyone who needs Windows-style INI config with round-trip fidelity, not just read-only parsing.

Comment-preserving read/write is a real differentiator — most Go INI libraries strip comments on SaveConfigFile, this one doesn't. Recursive sections and DEFAULT-section value interpolation cover the actual INI spec instead of a simplified subset. The Must* accessor pattern (MustInt, MustBool, etc.) with optional default values is a clean way to avoid error-checking boilerplate for config reads where a sane fallback is fine.

The README states it's in bug-fix-only mode and the author has moved on to go-ini/ini — you're adopting a dead-end library on day one. No struct tag/marshaling support, so you're stuck with GetValue/SetValue string-keyed access instead of binding into typed config structs like viper or go-ini offer. Last push was a year ago with no releases/tags visible in the tree, and CASE SENSITIVE keys being called out as a gotcha in the README is a sign of rough edges rather than a deliberate design choice.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →