config does not use ParseEnv option on nested keys.
beckend opened this issue · comments
Linken Quy Dinh commented
System (please complete the following information):
- OS:
linux
- GO Version:
1.16.4
- Pkg Version:
2.0.23
Describe the bug
config does not use ParseEnv
option on nested keys.
To Reproduce
import (
config "github.com/gookit/config/v2"
)
func BugReport() {
jsonStr := `{
"envKey": "${SHELL}",
"map1": {
"key1": "${SHELL}"
}
}`
config.AddDriver(config.JSONDriver)
config.WithOptions(config.ParseEnv)
_ = config.LoadStrings(config.JSON, jsonStr)
// works ok /bin/my-shell
fmt.Println(config.String("envKey", ""))
map1 := config.StringMap("map1")
// "${SHELL}"
fmt.Println("get map", map1["key1"])
}
Expected behavior
should give me /bin/bash
fmt.Println("get map", map1["key1"])
Linken Quy Dinh commented
@inhere you have to make a new release.
Inhere commented
has been released, thanks :)