This commit is contained in:
Josh Baker 2017-05-08 06:55:29 -07:00 committed by GitHub
parent 3f5adf1ba9
commit 19194a58d8
1 changed files with 4 additions and 5 deletions

View File

@ -10,7 +10,7 @@
<p align="center">get a json value quickly</a></p> <p align="center">get a json value quickly</a></p>
GJSON is a Go package that provides a [fast](#performance) and [simple](#get-a-value) way to get values from a json document. GJSON is a Go package that provides a [fast](#performance) and [simple](#get-a-value) way to get values from a json document.
It has features such as [one line retrieval](#get-a-value), [dot notation paths](#path-syntax), [iteration](#iterate-through-an-object-or-array). It can also [unmarshal](#unmarshalling) 3 to 4 times faster than the standard Go `json/encoding` unmarshaller. It has features such as [one line retrieval](#get-a-value), [dot notation paths](#path-syntax), [iteration](#iterate-through-an-object-or-array). It can also [unmarshal](#unmarshalling) 3 to 4 times faster than the standard Go `encoding/json` unmarshaller.
Getting Started Getting Started
=============== ===============
@ -235,10 +235,9 @@ if gjson.Get(json, "name.last").Exists(){
## Unmarshalling ## Unmarshalling
There's a `gjson.Unmarshal` function that loads json data into the value. There's a `gjson.Unmarshal` function which loads json data into a value.
It's a drop in replacement for `json.Unmarshal` and you can typically see a It's a drop in replacement for `json.Unmarshal` and you can typically
3 to 4 times boost in performance without the need for external tools or see a 3-4x boost in performance without the need for external generators.
generators.
This function works almost identically to `json.Unmarshal` except that it This function works almost identically to `json.Unmarshal` except that it
expects the json to be well-formed prior to being called. Invalid json expects the json to be well-formed prior to being called. Invalid json