altsrc: allow nested defaults in yaml files
Previously, defaults specified as nested keys in a yaml file would not be recognized, i.e. `top: \n bottom: key` would not be accessible using the name `top.bottom`, but `top.bottom: key` would. These changes support using nested keys by traversing the configuration tree if the key name uses '.' as a delimiter.
This commit is contained in:
@@ -296,7 +296,7 @@ func TestFloat64ApplyInputSourceMethodEnvVarSet(t *testing.T) {
|
||||
}
|
||||
|
||||
func runTest(t *testing.T, test testApplyInputSource) *cli.Context {
|
||||
inputSource := &MapInputSource{valueMap: map[string]interface{}{test.FlagName: test.MapValue}}
|
||||
inputSource := &MapInputSource{valueMap: map[interface{}]interface{}{test.FlagName: test.MapValue}}
|
||||
set := flag.NewFlagSet(test.FlagSetName, flag.ContinueOnError)
|
||||
c := cli.NewContext(nil, set, nil)
|
||||
if test.EnvVarName != "" && test.EnvVarValue != "" {
|
||||
|
Reference in New Issue
Block a user