Jason is designed to be convenient for reading arbitrary JSON while still honoring the strictness of the language. Inspired by other libraries and improved to work well for common use cases. It currently focuses on reading JSON data rather than creating it. [API Documentation](http://godoc.org/github.com/antonholmquist/jason) can be found on godoc.org.
## Install
```shell
go get github.com/antonholmquist/jason
```
## Import
```go
import (
"github.com/antonholmquist/jason"
)
```
## Data types
The following golang values are used to represent JSON data types. It is consistent with how `encoding/json` uses primitive types.
-`bool`, for JSON booleans
-`json.Number/float64/int64`, for JSON numbers
-`string`, for JSON strings
-`[]*Value`, for JSON arrays
-`map[string]*Value`, for JSON objects
-`nil` for JSON null
## Examples
### Create from bytes
Create object from bytes. Returns an error if the bytes are not valid JSON.
Looping through an array is done with `GetValueArray()` or `GetObjectArray()`. It returns an error if the value at that keypath is null (or something else than an array).
```go
friends, err := person.GetObjectArray("friends")
for _, friend := range friends {
name, err := friend.GetString("name")
age, err := friend.GetNumber("age")
}
```
### Loop through object
Looping through an object is easy. `GetObject()` returns an error if the value at that keypath is null (or something else than an object).