Documentation ¶
Index ¶
- func DeleteBOM(fileBytes []byte) []byte
- func MarshalIndent(obj interface{}) ([]byte, error)
- func MustMarshal(obj interface{}) []byte
- func MustMarshalIndentToString(obj interface{}) string
- func MustMarshalToString(obj interface{}) string
- func MustReadFile(path string, obj interface{})
- func MustUnmarshal(r []byte, obj interface{})
- func MustUnmarshalIgnoreEmptyString(jsonStr string, obj interface{})
- func MustUnmarshalToMap(r []byte) (obj map[string]interface{})
- func MustUnmarshalToMapDeleteBOM(r []byte) (obj map[string]interface{})
- func MustWriteFileIndent(path string, obj interface{})
- func ReadFile(path string, obj interface{}) error
- func ReadFileTypeFix(path string, obj interface{}) error
- func TypeFixWhenMarshal(obj interface{}) (out interface{}, err error)
- func UnmarshalNoType(r []byte) (interface{}, error)
- func WriteFile(path string, obj interface{}) (err error)
- func WriteFileTypeFix(path string, obj interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalIndent ¶
func MustMarshal ¶
func MustMarshal(obj interface{}) []byte
func MustMarshalIndentToString ¶
func MustMarshalIndentToString(obj interface{}) string
for debug to inspect content in obj
func MustMarshalToString ¶
func MustMarshalToString(obj interface{}) string
func MustReadFile ¶
func MustReadFile(path string, obj interface{})
func MustUnmarshal ¶
func MustUnmarshal(r []byte, obj interface{})
func MustUnmarshalIgnoreEmptyString ¶
func MustUnmarshalIgnoreEmptyString(jsonStr string, obj interface{})
func MustUnmarshalToMap ¶
func MustWriteFileIndent ¶
func MustWriteFileIndent(path string, obj interface{})
func ReadFileTypeFix ¶
读取json文件,并修正json的类型问题(map key 必须是string的问题)
func TypeFixWhenMarshal ¶
func TypeFixWhenMarshal(obj interface{}) (out interface{}, err error)
修正序列化时的类型问题,此处直接把类型搞定,(此处会忽略对系统的json有效的tag) TODO finish it
func UnmarshalNoType ¶
func WriteFileTypeFix ¶
写入json文件,并修正json的类型问题(map key 必须是string的问题)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.