// Pretty prettifies specified json string.
Pretty prettifies specified json string.
// Pretty prettifies specified json string .
func Pretty(jsonStr string, i string, w int, colorScheme *ColorScheme) (string, error) {
	if !gjson.Valid(jsonStr) {
		return "", errors.New("parse error: Invalid json input")
	}
	json := gjson.Parse(jsonStr)
	indent = i
	width = w
	if colorScheme != nil {
		coloring = colorScheme
	} else {
		coloring = DefaultScheme
	}
	var builder bytes.Buffer
	prettyRec(&builder, 0, json)
	return builder.String(), nil
}
func Pretty ( jsonStr string , i string , w int , colorScheme * ColorScheme ) ( string , error ) { if ! gjson . Valid ( jsonStr ) { return " " , errors . New ( " " ) } json := gjson . Parse ( jsonStr ) indent = i width = w if colorScheme != nil { coloring = colorScheme } else { coloring = DefaultScheme } var builder bytes . Buffer prettyRec ( & builder , 0 , json ) return builder . String ( ) , nil }
Pretty prettifies specified json string.
Pretty prettifies specified json string .