gjson

package module
v0.0.0-...-2691afe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2019 License: MIT Imports: 2 Imported by: 0

README

gjson - Fast JSON Parser written in pure Go

Build Status Coverage Status Go Report Card GoDoc

Installation
$ go get -u github.com/yagi5/gjson
Usage
package main

import (
	"fmt"

	"github.com/yagi5/gjson"
)

func main() {
	js := `{
			"key": "a", 
			"key2": [1, "a", true, null]
		}`
	jsMap, err := gjson.Decode([]byte(js))
	if err != nil {
		panic(err)
	}
	for key, val := range jsMap {
		fmt.Println(key)
		fmt.Println(val)
	}
}

// Output
// key
// a
// key2
// [1 a true nil]
Lisence

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte) (val map[string]interface{}, err error)

Decode returns parsed json object. arg must be started "{" and valid as JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL