From 4c7d6ff4a9669157760c888a3d37cdf7694551e8 Mon Sep 17 00:00:00 2001 From: Dustin Blackman Date: Thu, 25 Oct 2018 16:34:28 -0400 Subject: [PATCH] fix GetManyBytes to use byte related methods --- gjson.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gjson.go b/gjson.go index 74515ed..418da5d 100644 --- a/gjson.go +++ b/gjson.go @@ -1626,7 +1626,11 @@ func GetMany(json string, path ...string) []Result { // The return value is a Result array where the number of items // will be equal to the number of input paths. func GetManyBytes(json []byte, path ...string) []Result { - return GetMany(string(json), path...) + res := make([]Result, len(path)) + for i, path := range path { + res[i] = GetBytes(json, path) + } + return res } var fieldsmu sync.RWMutex