Open tarunlalwani opened 3 years ago
Hi tarunlalwani,
if you add a test case I can merge this. In your use case it is actually not necessary. You could simply cast d to an map:
filter, _ := jsonpath.Get(jsonFilter, map[string]interface{}(d))
That will do the trick and is faster since it doesn't require reflection.
I got a little confused with the title MasterData
isn't a struct. It's just a custom type.
This fixes the problem where
jsonpath.Get
doesn't work if the root object is a struct instead of blank interface.I wrote the below test that shows the issues and also the patch working
Output: