Documentation ¶
Overview ¶
Package jsonfmt provides functionality for formatting JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format parses and formats the input JSON according to provided Options. If err is non-nil, then the output is a best effort at processing the input.
This function accepts a superset of the JSON specification that allows comments and trailing commas after the last element in an object or array.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures how to format JSON.
func Minify ¶
func Minify() Option
Minify configures Format to produce the minimal representation of the input. If Format returns no error, then the output is guaranteed to be valid JSON,
func Standardize ¶
func Standardize() Option
Standardize configures Format to produce valid JSON according to ECMA-404. This strips any comments and trailing commas.