add defaut config parser

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-13 13:17:38 +03:00
parent a7a3c679d1
commit 2dcd30b21c
2 changed files with 11 additions and 1 deletions

View File

@@ -173,6 +173,12 @@ func (c *defaultConfig) fillValues(ctx context.Context, valueOf reflect.Value) e
continue
}
switch value.Kind() {
case reflect.Struct:
value.Set(reflect.Indirect(reflect.New(value.Type())))
if err := c.fillValues(ctx, value); err != nil {
return err
}
continue
case reflect.Ptr:
if value.IsNil() {
if value.Type().Elem().Kind() != reflect.Struct {