Documentation ¶
Index ¶
- func Indent(jsonStr string) string
- func Marshal(obj interface{}) (result string, err error)
- func MarshalIndent(obj interface{}) (result string, err error)
- func Remarshal(obj interface{}, remarshalledObj interface{}) (err error)
- func Unmarshal(jsonContent string, dest interface{}) (err error)
- func UnmarshalFile(filePath string, dest interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalIndent ¶
MarshalIndent is like Marshal but applies Indent to format the output. Returns empty string if marshal fails
func Remarshal ¶
func Remarshal(obj interface{}, remarshalledObj interface{}) (err error)
Remarshal marshals an object to Json then parses it back to another object. This is useful for example when we want to go from map[string]interface{} to a more specific struct type or if we want a deep copy of the object.
func UnmarshalFile ¶
UnmarshalFile reads the content of a file then Unmarshals the content to an object.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.