4 ms·
I'm writing something similar for Go: passed flags override env vars, which override the config file, which overrides defaults set in the code. With 4(!) sourc
by bbkane 2y ago
I'm writing something similar for Go: passed flags override env vars, which override the config file, which overrides defaults set in the code.
With 4(!) sources of configuration to keep track of, I've also made --help print out current values and the source for it (i.e. the password came from an environment variable and the base_url came from a config file).
It's been tremendously satisfying to use this library for my own projects, as everything works exactly the way I expect (and if it doesn't I change the library).
Code at https://github.com/bbkane/warg https://github.com/bbkane/warg if you want to compare it to your library :)