config: make the replace function marginally more understandable
This commit is contained in:
parent
22908d67ba
commit
c6424e9569
|
@ -210,8 +210,8 @@ func (w *interpolationWalker) removeCurrent() {
|
||||||
w.unknownKeys = append(w.unknownKeys, strings.Join(w.key, "."))
|
w.unknownKeys = append(w.unknownKeys, strings.Join(w.key, "."))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *interpolationWalker) replace(v reflect.Value, offset int) {
|
func (w *interpolationWalker) replaceCurrent(v reflect.Value) {
|
||||||
c := w.cs[len(w.cs)-1+offset]
|
c := w.cs[len(w.cs)-2]
|
||||||
switch c.Kind() {
|
switch c.Kind() {
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
// Get the key and delete it
|
// Get the key and delete it
|
||||||
|
@ -273,5 +273,5 @@ func (w *interpolationWalker) splitSlice() {
|
||||||
|
|
||||||
// Our slice is now done, we have to replace the slice now
|
// Our slice is now done, we have to replace the slice now
|
||||||
// with this new one that we have.
|
// with this new one that we have.
|
||||||
w.replace(reflect.ValueOf(result), -1)
|
w.replaceCurrent(reflect.ValueOf(result))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue