json

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name          = "go_json"
	Marshal       = json.Marshal
	Unmarshal     = json.Unmarshal
	MarshalIndent = json.MarshalIndent
	NewDecoder    = json.NewDecoder
	NewEncoder    = json.NewEncoder
)

Functions

func MustJSON

func MustJSON(v any) []byte

MustJSON 转 json 返回 []byte

func MustJSONIndent

func MustJSONIndent(v any) []byte

MustJSONIndent 转 json 返回 []byte

func MustJSONIndentString

func MustJSONIndentString(v any) string

MustJSONIndentString 转 json 返回 string

func MustJSONString

func MustJSONString(v any) string

MustJSONString 转 json 返回 string

func MustJSONUnEscape added in v0.0.16

func MustJSONUnEscape(v any) []byte

MustJSONUnEscape 转 json 返回 []byte, 不转义 ( '&', '<', '>' )

func MustJSONUnEscapeIndent added in v0.0.16

func MustJSONUnEscapeIndent(v any) []byte

MustJSONUnEscapeIndent 转 json 返回 []byte, 不转义 ( '&', '<', '>' )

func MustJSONUnEscapeIndentString added in v0.0.16

func MustJSONUnEscapeIndentString(v any) string

MustJSONUnEscapeIndentString 转 json 返回 string, 不转义 ( '&', '<', '>' )

func MustJSONUnEscapeString added in v0.0.16

func MustJSONUnEscapeString(v any) string

MustJSONUnEscapeString 转 json 返回 string, 不转义 ( '&', '<', '>' )

Types

type RawMessage

type RawMessage []byte

func (RawMessage) Copy

func (m RawMessage) Copy() []byte

Copy returns a copy of m.

func (RawMessage) MarshalJSON

func (m RawMessage) MarshalJSON() ([]byte, error)

MarshalJSON returns m as the JSON encoding of m.

func (*RawMessage) UnmarshalJSON

func (m *RawMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

Jump to

Keyboard shortcuts

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