jsonUtilities

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJSONDecode = errors.New("failed to decode JSON")
View Source
var ErrOpenFile = errors.New("failed to open file")
View Source
var ErrReadFile = errors.New("failed to read file")

Functions

func DecodeJSONFile

func DecodeJSONFile(filename string) (map[string]interface{}, error)

DecodeJSONFile returns the contents of a json file as a map

func IsJSONArray

func IsJSONArray(v []byte) bool

IsJSONArray returns true if the byte array represents a JSON array

func IsJSONObject

func IsJSONObject(v []byte) bool

IsJSONObject returns true if the byte array represents a JSON object

func IsValidJSON

func IsValidJSON(v []byte) bool

IsValidJSON returns true if the given byte array is a JSON array of JSON object

func UnescapeJSON

func UnescapeJSON(v []byte) string

UnescapeJSON replaces unicode escape characters with the actual character

Types

type JsonDecodeError

type JsonDecodeError struct {
	Err error
}

Jump to

Keyboard shortcuts

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