YZhenY / bijson

JSON Serialiser which accomodates to big.Int

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bijson: optimized standard library JSON for Go

Clone of fastjson by intel-go,bijson has the same API as json from standard library encoding/json.

Getting Started

$go get github.com/YZhenY/bijson

##Example

import (
    "github.com/YZhenY/bijson"
    "fmt"
)

func main() {
    var jsonBlob = []byte(`[
	{"Name": "Platypus", "Order": "Monotremata"},
	{"Name": "Quoll",    "Order": "Dasyuromorphia"}
    ]`)
    type Animal struct {
	Name  string
	Order string
    }
    var animals []Animal
    err := bijson.Unmarshal(jsonBlob, &animals)
    if err != nil {
	fmt.Println("error:", err)
    }
    fmt.Printf("%+v", animals)
    // Output:
    // [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
}

##API API is the same as encoding/json GoDoc

About

JSON Serialiser which accomodates to big.Int

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%