Closed emrekosen closed 11 months ago
I can do this since it's 1 minute solution :) Also we need this in go-dcp and other projects.
Thank you, I want to ask a question. If we did this, what would be their benefits?
Right now we can't read configs with viper package by just parsing viper data to config.Connector
struct. If anybody wants to use viper it's not possible. In our team we use viper for dynamic configuration also and it will provide that.
Our current logic is parsing config file to another struct and map it to config.Connector
.
I don't know if i explained well. I can provide more detail.
@emrekosen I understand your concerns you are right. If we remove the inline tag and add mapstructure, will it work the same? We need to test it. If you find an available time I would be happy to review your pull request.
@mhmtszr No we don't need to remove inline tag, we can use both yaml and mapstructure. With a tag like yaml:",inline" mapstructure:",squash"
we can support both inline yaml and inline mapstrucure. I will implement and create pull request.
Is your feature request related to a problem? Please describe. When using viper package to read config files, we can't parse config directly to struct provided by package which is
config.Connector
. It's because viper uses mapstructure tags and we have yaml tags. Withyaml:",inline"
tag dcp field inconfig.Connector
, viper unable to read inlined config fields.Describe the solution you'd like If we add
mapstructure
tags to config struct it will be resolved.