config
config copied to clipboard
Add support of Map
Perhaps updating the dependency will be enough
github.com/iamolegga/enviper v1.4.0
to v1.4.2
That did not work for me. I believe because of https://github.com/iamolegga/enviper/blob/76a709d405c3d4aaafcea174dda051b8a39c5bcd/enviper_test.go#L90
Fix in v1.4.2
allows to read from a file like this
Map:
'key1': 'val1'
'key2': 'val2'
var Config struct {
Map map[string]string
}
config.NewConfReader("config").Read(&Config)
Got it. It supports only config files, right? Env vars are not yet supported I suppose.
I tried env vars like here https://github.com/num30/config/blob/ddeb8abccdae0d1b0ae1dada9490b1f140fbb2b6/config_test.go#L423 and it does not init the map. Also, I tried the code snippet from documentation and it did not init the map either.
Honestly, I just now saw such syntax there) I needed to make this case work
I got that syntax from Readme. It would be fine to have something like TESTMAP="a:1,b:2"