Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToJSON ¶
ToJSON strips out comments and trailing commas and convert the input to a valid JSON per the official spec: https://tools.ietf.org/html/rfc8259
The resulting JSON will always be the same length as the input and it will include all of the same line breaks at matching offsets. This is to ensure the result can be later processed by a external parser and that that parser will report messages or errors with the correct offsets.
func ToJSONInPlace ¶
ToJSONInPlace is the same as ToJSON, but this method reuses the input json buffer to avoid allocations. Do not use the original bytes slice upon return.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.