-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Dynamically bind all environment variables based on a config struct #1797
Comments
👋 Thanks for reporting! A maintainer will take a look at your issue shortly. 👀 In the meantime: We are working on Viper v2 and we would love to hear your thoughts about what you like or don't like about Viper, so we can improve or fix those issues. ⏰ If you have a couple minutes, please take some time and share your thoughts: https://forms.gle/R6faU74qPRPAzchZ9 📣 If you've already given us your feedback, you can still help by spreading the news, https://twitter.com/sagikazarmark/status/1306904078967074816 Thank you! ❤️ |
@mehdy I have the same issue as you. Your method seems similar to the one mentioned in #584. Viper has implemented
|
That's weird and undocumented! But then it means I should close this issue. |
Preflight Checklist
Problem Description
When you want to use environment variables as a source of configuration you need to bind each item explicitly or have another source of configuration to populate the store and then be able to use
AutomaticEnv
to override the values from the environment variables.So this piece of code is not doing what I'd expect:
P.S. This feels like an issue that should've been brought up many times but couldn't find another issue like this so I apologize in-advance if it's redundant.
Proposed Solution
To solve the issue I wrote this function and it could be a part of Viper itself.
So if Viper had a method like this it'd be so easy to tell it to bind all configurations defined by my Config struct.
If you're up for it I'd like to make a PR for it.
Alternatives Considered
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: