Replies: 1 comment
-
Thanks @Oxxyg33n, this is a good suggestion. I think we may already have an issue open for this. The idea is to decouple some components from the Viper core and give more control to users (ie. let you implement your own logic for parsing env files). I've been working on those changes for some time now. The latest batch can be found in this PR: #1167 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, Viper community
Another suggestion from me is to extend env variables prefix support, with another package I'm using, I'm able to parse .env files configuration with using some application prefix, let's say prefix is
EX
and my .env files contain variables likeEX_ENVIRONMENT
, but my configuration structure looks like this:Which reads later from .env file as EX_ENVIRONMENT variable, I was expecting
viper.SetEnvPrefix("EX")
to do the same thing, but seems it only works when reading from environment variables and bindenv method. Is it possible to make it the same way so thatStructure above, with
viper.SetEnvPrefix("EX")
set, would readEX_ENVIRONMENT
from .env file as I'm expecting? I'd rather do not do something likeBecause when you are having 50+ microservices it's getting a bit hard, especially when the variables are being shared between services using shared embedded structures?
Beta Was this translation helpful? Give feedback.
All reactions