From b0a5bd42638a1741a277cb72fabc508507b124e6 Mon Sep 17 00:00:00 2001 From: Tino Rusch Date: Fri, 12 Aug 2016 13:32:37 +0200 Subject: [PATCH] expose rquery as func 'Get' on the json object for usecases where you don't care about the type (i.e. abstract functions like the projection of json data); --- jsonq.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jsonq.go b/jsonq.go index 5b3e2b3..1ba0c92 100644 --- a/jsonq.go +++ b/jsonq.go @@ -86,6 +86,11 @@ func NewQuery(data interface{}) *JsonQuery { return j } +// Get extracts a untyped field from the JsonQuery +func (j *JsonQuery) Get(s ...string) (interface{}, error) { + return rquery(j.blob, s...) +} + // Bool extracts a bool the JsonQuery func (j *JsonQuery) Bool(s ...string) (bool, error) { val, err := rquery(j.blob, s...)