diff --git a/configuration/parser.go b/configuration/parser.go index 6d6451800..017d63a9b 100644 --- a/configuration/parser.go +++ b/configuration/parser.go @@ -166,6 +166,17 @@ func (p *Parser) overwriteFields(v reflect.Value, fullpath string, path []string return p.overwriteStruct(v, fullpath, path, payload) case reflect.Map: return p.overwriteMap(v, fullpath, path, payload) + case reflect.Slice: + idx, err := strconv.Atoi(path[0]) + if err != nil { + panic("non-numeric index: " + path[0]) + } + + if idx >= v.Len() { + panic("Undefined index: " + path[0]) + } + + return p.overwriteFields(v.Index(idx), fullpath, path[1:], payload) case reflect.Interface: if v.NumMethod() == 0 { if !v.IsNil() {