Documentation
¶
Overview ¶
Package lenientjson turns the JSON that Json.NET (Newtonsoft.Json) reads into strict JSON for encoding/json: it decodes a UTF-8, UTF-16 or UTF-32 BOM and strips comments and trailing commas; accepts single-quoted strings, unquoted property names, bare decimal points and NaN/Infinity/undefined; and escapes control characters inside strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTruncated = errors.New("lenientjson: input ends inside a UTF-16 or UTF-32 code unit")
ErrTruncated reports a UTF-16 or UTF-32 input that ends inside a code unit.
Functions ¶
func Clean ¶
Clean rewrites b as strict JSON where Json.NET would read it. Text Json.NET rejects is left for encoding/json to reject; string contents are never rewritten beyond escaping. Newlines are kept, so a *json.SyntaxError's line counted over the result is the source line. Input that ends inside a UTF-16 or UTF-32 code unit is returned unchanged, which encoding/json rejects; TryClean reports it as an error.
Types ¶
This section is empty.