diff --git a/api.go b/api.go index 33e9b0e16..919a6d125 100644 --- a/api.go +++ b/api.go @@ -207,6 +207,8 @@ func Get(src []byte, path ...interface{}) (ast.Node, error) { return GetCopyFromString(rt.Mem2Str(src), path...) } +//GetWithOptions searches and locates the given path from src json, +// with specific options of ast.Searcher func GetWithOptions(src []byte, opts ast.SearchOptions, path ...interface{}) (ast.Node, error) { s := ast.NewSearcher(rt.Mem2Str(src)) s.SearchOptions = opts