cleanenv
cleanenv copied to clipboard
Does this support parsing `map[string]CustomStruct` using the `env` tag?
For example, I have the following Config root
var RootConfig Root
type Root struct {
Http map[string]HttpConfig `yaml:"http" env:"HTTP"`
}
type HttpConfig struct {
Host string `yaml:"host"`
TimeoutMs int `yaml:"timeout_ms"`
}
func Load(configPath string) {
cleanenv.ReadConfig(configPath, &RootConfig)
}
I know I can provide the following to populate http
key via the following yaml
structure:
http:
payment:
host: "http://payment:4000"
timeout_ms: 2000
But what about via environment variable? What would HTTP
env var look like?
i'm also interested here as i have a similar usecase :)
would be really great if this would be possible
Bumping this issue, have a problem with a map, too.