Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyEncode ¶
If you use json.Encode, you can set indentation through Encoder. SetIndent method similarly to as in marshaling, by defining a prefix and indent.
func PrettyString ¶
Package encoding/json also has a useful function json.Indent to beautify JSON string without indentation to JSON with indentation. The function needs the source JSON, output buffer, prefix, and indent.
func PrettyStruct ¶
Function json.MarshalIndent generates JSON encoding of the value with indentation. You can specify a prefix of each JSON line and indent copied one or more times according to the indentation level. In our example, we pretty-print JSON using four spaces for indentation.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.