json

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 6 Imported by: 0

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