From cc5c92737ba97e1e4035fb63bc9ca322358c909a Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 15 Mar 2021 00:45:17 +0330 Subject: [PATCH] fix bug when collection is map[string]interface{} using json feeder --- config.go | 4 ++++ go.sum | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 7755bdb..6389f39 100644 --- a/config.go +++ b/config.go @@ -273,6 +273,10 @@ func find(collection interface{}, key string) (interface{}, error) { if v, ok := collection.(map[interface{}]interface{})[key]; ok { return v, nil } + case map[string]interface{}: + if v, ok := collection.(map[string]interface{})[key]; ok { + return v, nil + } case []interface{}: k, err := strconv.Atoi(key) if err == nil && len(collection.([]interface{})) > k { diff --git a/go.sum b/go.sum index d10bc26..6810c2e 100644 --- a/go.sum +++ b/go.sum @@ -7,7 +7,6 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=