Documentation
¶
Index ¶
- func Decode(data string, v any) error
- func Encode(v any) string
- func Get(js, path string) interface{}
- func Marshal(v any) ([]byte, error)
- func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- func MarshalSorted(v interface{}) ([]byte, error)
- func MarshalString(v any) (string, error)
- func NumSafeDecode(jsonStr string, dst interface{}) error
- func Unmarshal(data []byte, v any) error
- func UnmarshalString(data string, v any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(js, path string) interface{}
Get 从json字符串js中读取指定路径path(以/作为路径分割)的值 如果指定路径不存在,返回nil
func MarshalIndent ¶
MarshalIndent 带有缩进的Marshal
func MarshalSorted ¶
MarshalSorted 将任意对象v进行json编码,并对key进行排序
func MarshalString ¶
MarshalString 将Marshal得到的字节数组转换为字符串(json)并返回
func NumSafeDecode ¶
NumSafeDecode 数字安全的 json 解码
func UnmarshalString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.