spf13/viper ? reverse-engineered prompt
Reverse engineered prompt
Build me a Go configuration library like Viper, with a simple way for an app to read settings from lots of places and have them all merge together.
I want it to handle defaults, explicit values, environment variables, command line flags, config files, and reading from a buffer or remote key value store. It should support common config formats like JSON, YAML, TOML, INI, env files, and Java properties, and let me search for a config file in multiple locations. It should also be able to write config back out, watch for file changes, and reload automatically when the file changes.
Please keep the API easy to use, case insensitive for keys, and make sure it supports aliases for keys and reading nested values. If anything is unclear, look at the existing docs and tests, and check current Go docs online if needed. I’d like it to feel like a solid drop in config package for real Go apps.
Are you gonna build this?
make sure you review the code using coderabbit