Documentation
¶
Index ¶
- func IndentJson(data any) string
- func Marshal(v any) ([]byte, error)
- func PrintAny(data any) string
- func ReadyJsonFile(filePath string, v any) (resErr error)
- func StripComments(data []byte) ([]byte, error)
- func ToByte(data any) ([]byte, error)
- func ToMap(val any) (resData map[string]any, resErr error)
- func ToMapStr(val any) (resData map[string]string, resErr error)
- func ToStr(data any) string
- func Unmarshal(data []byte, v any) error
- func UnmarshalJsonc(data []byte, v any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadyJsonFile ¶ added in v0.4.7
读取一个包含注释的 JSON 文件,去除注释后返回标准 JSON 格式的数据。 var result map[string]any err := ReadyJsonFile("demo.json", &result)
func StripComments ¶ added in v0.4.7
func UnmarshalJsonc ¶ added in v0.4.7
解析带注释的 JSON 数据 var result map[string]any err := UnmarshalJsonc([]byte(str), &result)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.