jsonx

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 2 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(value interface{}) string

Marshal 将interface{}类型的值转换成json字符串,失败将产生panic

func MarshalAndIndent

func MarshalAndIndent(v interface{}) string

MarshalAndIndent .

func MarshalAndIntend

func MarshalAndIntend(v interface{}) string

MarshalAndIntend deprcated ! Use MarshalAndIndent

func ToMap

func ToMap(str string) (map[string]interface{}, error)

ToMap 解析字符串到结构体或者map[string]interface{}中,out为指针类型

func Unmarshal

func Unmarshal(str string, out interface{}) error

Unmarshal .

Types

type JSONBytes

type JSONBytes []byte

JSONBytes .

func (JSONBytes) MarshalJSON

func (bs JSONBytes) MarshalJSON() ([]byte, error)

MarshalJSON .

func (JSONBytes) Unmarshal

func (bs JSONBytes) Unmarshal(out interface{}) error

Unmarshal .

func (*JSONBytes) UnmarshalJSON

func (bs *JSONBytes) UnmarshalJSON(b []byte) error

UnmarshalJSON .

Jump to

Keyboard shortcuts

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