From bf6065bf37c1b463c2b6c3157e50fe60165b1a01 Mon Sep 17 00:00:00 2001 From: Olivier Tardieu Date: Wed, 24 Apr 2024 12:54:02 -0400 Subject: [PATCH] Fix bug in getValueAtPath for array index expression --- pkg/utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 6bd515c..d4779de 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -118,8 +118,8 @@ func getValueAtPath(obj map[string]interface{}, path string) (interface{}, error return nil, fmt.Errorf("at path position '%v' out of bounds index '%v'", processed, index) } cursor = asArray[index] - remaining = remaining[end+1:] processed += remaining[0:end] + remaining = remaining[end+1:] } else if strings.HasPrefix(remaining, ".") { // Field reference expression remaining = remaining[1:]