Replies: 2 comments 1 reply
-
|
@treddy73 seems it's supported like |
Beta Was this translation helpful? Give feedback.
-
|
I don't believe Viper has any support for this scenario. If you look at GetStringMap it is just a wrapper for the If you ask me this is a serious limitation in Viper and makes it a bit lacking compared to offerings for other programming languages such as .Net or Node.js. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently using a YAML file for my configuration and it has a structure like:
v.GetStringMap("db.dataSourceName")returns a map that contains all of the child keys and it seems to work the way I want it to. I do this to help programmatically build the data source name.However, if I use environment variables like:
and I additionally configure Viper:
then
v.GetStringMap("db.dataSourceName")returnsnil.I am able to get the individual keys directly
v.GetString("db.dataSourceName.dbname")for instance.Am I unable to grab a hierarchy of keys from an ENV configuration?
Beta Was this translation helpful? Give feedback.
All reactions