From a771eeb5c537c3683ed893ec252341ed551290eb Mon Sep 17 00:00:00 2001 From: liuyong Date: Sun, 14 Aug 2022 14:44:49 +0800 Subject: [PATCH 1/2] add FromByteArray --- jsonq.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jsonq.go b/jsonq.go index 3fb90ef..ef99478 100644 --- a/jsonq.go +++ b/jsonq.go @@ -97,6 +97,12 @@ func (j *JSONQ) FromString(str string) *JSONQ { return j.decode() // handle error } +// FromByteArray reads the content from valid json/xml/csv/yml string +func (j *JSONQ) FromByteArray(str []byte) *JSONQ { + j.raw = str + return j.decode() // handle error +} + // Reader reads the json content from io reader func (j *JSONQ) Reader(r io.Reader) *JSONQ { buf := new(bytes.Buffer) From c1a9e160025fa195da8013cc77d561f488d08920 Mon Sep 17 00:00:00 2001 From: liuyong Date: Mon, 15 Aug 2022 11:25:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5497deb..1a9580a 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/thedevsaddam/gojsonq/v2 +module github.com/esperyong/gojsonq/v2 go 1.13