json

package
v4.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package json implements encoding and decoding of JSON as defined in RFC 7159.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Marshal marshal v to string
	Marshal = json.Marshal
	// MarshalIndent marshal v to string with indent
	MarshalIndent = json.MarshalIndent
	// NewDecoder returns a new decoder that reads from r.
	//
	// The decoder introduces its own buffering and may
	// read data from r beyond the JSON values requested.
	NewDecoder = json.NewDecoder
)

Functions

func MarshalToString

func MarshalToString(v interface{}) (string, error)

MarshalToString marshal v to string

func Unmarshal

func Unmarshal(data []byte, v interface{}) (err error)

Unmarshal unmarshal json, support comment

func UnmarshalFromString

func UnmarshalFromString(str string, v interface{}) (err error)

UnmarshalFromString unmarshal json from string, support comment

Types

This section is empty.

Jump to

Keyboard shortcuts

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