-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Usage to print values #77
Comments
This seems like a debugging use case? I can understand applications needing to:
I'm trying to wrap my head around the need for this or find precedent anywhere else. It would be like if |
I think @AlekSi might be trying to solve the problem of "What the heck actually got applied from the env vars I passed" because it can be challenging to figure out which were actually picked up. I wrote a thing which we use to solve that: https://github.com/relistan/rubberneck Configure your app with envconfig, and then on startup have it dump the config it's running from to the logs. You could also do this from a CLI switch if needed. I find it useful. Maybe it solves this problem and it doesn't need to be solved in envconfig. You could alternatively dump a TOML or YAML file from your config struct if you don't like Rubberneck. |
@relistan that package looks great! I agree it's not really the job of envconfig -- I'll be pointing people to rubberneck next time this comes up. |
Thanks @teepark! |
This way
Usage()
can be used after processing to print applied configuration as a better-looking alternative tofmt.Printf("%+v\n", config)
.The text was updated successfully, but these errors were encountered: