From b9df5c56b824f96421b0c062ff0135ef80415511 Mon Sep 17 00:00:00 2001 From: Danilo Marques Date: Sun, 5 Jun 2022 14:21:05 -0300 Subject: [PATCH] Issue #51: - removing the `continue` from the for loop. --- document.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/document.go b/document.go index 5e5ebdb..81e07f2 100644 --- a/document.go +++ b/document.go @@ -49,6 +49,7 @@ func (doc *Document) Copy() *Document { } } +// force tells that if we did not finding anything we should create func lookupField(name string, fieldMap map[string]interface{}, force bool) (map[string]interface{}, interface{}, string) { fields := strings.Split(name, ".") @@ -76,7 +77,7 @@ func lookupField(name string, fieldMap map[string]interface{}, force bool) (map[ s, isSlice := f.([]interface{}) if isSlice { if i < end-1 { - v, increment := lookupSliceField(fields[i+1:], 2, s) + v, increment := lookupSliceField(fields[i+1:], 1, s) if v == nil { return nil, nil, "" } else if m, isMap := v.(map[string]interface{}); isMap { @@ -86,7 +87,6 @@ func lookupField(name string, fieldMap map[string]interface{}, force bool) (map[ } i += increment - continue } } else if i < end-1 { currMap = m