kmgJson

package
v0.0.0-...-05317bf Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBOM

func DeleteBOM(fileBytes []byte) []byte

func MarshalIndent

func MarshalIndent(obj interface{}) ([]byte, error)

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 MustUnmarshalToMap(r []byte) (obj map[string]interface{})

func MustUnmarshalToMapDeleteBOM

func MustUnmarshalToMapDeleteBOM(r []byte) (obj map[string]interface{})

func MustWriteFileIndent

func MustWriteFileIndent(path string, obj interface{})

func ReadFile

func ReadFile(path string, obj interface{}) error

func ReadFileTypeFix

func ReadFileTypeFix(path string, obj interface{}) error

读取json文件,并修正json的类型问题(map key 必须是string的问题)

func TypeFixWhenMarshal

func TypeFixWhenMarshal(obj interface{}) (out interface{}, err error)

修正序列化时的类型问题,此处直接把类型搞定,(此处会忽略对系统的json有效的tag) TODO finish it

func UnmarshalNoType

func UnmarshalNoType(r []byte) (interface{}, error)

func WriteFile

func WriteFile(path string, obj interface{}) (err error)

func WriteFileTypeFix

func WriteFileTypeFix(path string, obj interface{}) (err error)

写入json文件,并修正json的类型问题(map key 必须是string的问题)

Types

This section is empty.

Jump to

Keyboard shortcuts

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