Viper – Go Configuration with Fangs
github.com
github.com
16 direct dependencies, 39 transitive dependencies, and nearly 7000 lines of code -- for a package that handles flags and config files. I can't help feeling that frameworks like this are a little overwrought. It's the sort of project that succeeds because thousands of people just need something that works, right away, so they search for "golang config" and click the top result. Whereas if you can afford to slow down a little, you might find that the stdlib (with a bit of glue) is a perfectly serviceable option for the majority of apps.
Viper has sophisticated functionality such that it might read a config file from one of several paths; the properties of which can be overridden with environment variables or command line flags.
With an emphasis on productivity, I think those mechanisms are useful, and probably not worth spending time to NIH from stdlib.
Most importantly:
- Breaks JSON, YAML, TOML etc. language specs by forcibly lowercasing all keys internally. Dangerous because it can silently merge differently cased config keys into lowercase.
- Hard codes big unnecessary dependencies into the core, significantly bloating build sizes. No separation or abstraction.