commit 4dbaa0e558653a0243286a132291818043fbc12a
parent 3d991e95a8197d6bc05e10dff748d8a0464784e9
Author: francoispqt <francois@parquet.ninja>
Date: Fri, 27 Apr 2018 00:53:34 +0800
update README
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -6,6 +6,8 @@
![MIT License](https://img.shields.io/badge/license-mit-blue.svg?style=flat-square)
# GoJay
+**Package is currently at version 0.9 and still under development**
+
GoJay is a performant JSON encoder/decoder for Golang (currently the most performant, [see benchmarks](#benchmark-results)).
It has a simple API and doesn't use reflection. It relies on small interfaces to decode/encode structures and slices.
@@ -55,6 +57,19 @@ func main() {
}
```
+Or with the Decoder API (which takes an io.Reader):
+```go
+func main() {
+ u := &user{}
+ dec := gojay.NewDecoder(strings.NewReader(`{"id":1,"name":"gojay","email":"gojay@email.com"}`))
+ err := dec.Decode(u)
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+```
+
+
### Structs
#### UnmarshalerObject Interface