Merge pull request #97 from dustinblackman/fix/getmanybytes

Fix GetManyBytes to use byte related methods
This commit is contained in:
Josh Baker 2018-10-28 08:42:31 -07:00 committed by GitHub
commit 1bd06b6ad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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