Documentation
¶
Overview ¶
Package jsonutil provides JSON formatting utilities.
The package supports pretty printing with indentation. Keys are always sorted alphabetically by Go's json.Marshal, ensuring consistent output for diffing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TryFormat ¶
TryFormat attempts to format a JSON string with indentation. Returns the formatted string and true if successful, or the original string and false if not valid JSON. This is useful for commands that need to know whether formatting was applied.
func TryFormatOrWarn ¶
TryFormatOrWarn formats JSON or warns and returns original. If name is non-empty, includes it in the warning message.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.