json

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package json exists because dynamic unmarshalling of JSON to either a Slice or Map is not easily afforded by encoding/json.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPrimitiveRootType signals that a decoded data structure is primitive,
	// i.e. not an object or array, and therefore cannot be root.
	ErrPrimitiveRootType = errors.New("root type is primitive")

	// ErrMultipleRoots signals that multiple data structures were decoded.
	ErrMultipleRoots = errors.New("multiple roots")
)

Functions

func Parse

func Parse(reader io.Reader) (interface{}, error)

Parse returns parsed JSON. It decodes the first JSON data structure from reader. If there is more than one structure in reader, it errors. If the data structure is a primitive type, i.e. not an object or array, it errors.

Types

This section is empty.

Jump to

Keyboard shortcuts

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