Documentation
¶
Overview ¶
Package strictjson rejects text encodings that Go's JSON decoders would otherwise repair lossily before callers can enforce exact-text guarantees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidUTF8 = errors.New("JSON text is not valid UTF-8") ErrInvalidSurrogate = errors.New("JSON text contains an invalid Unicode surrogate escape") )
Functions ¶
func ValidateText ¶
ValidateText checks raw JSON text for valid UTF-8 and correctly paired UTF-16 surrogate escapes. The normal JSON decoder remains responsible for all other syntax validation.
func ValidateUniqueKeys ¶ added in v0.1.6
ValidateUniqueKeys rejects object members that encoding/json could overwrite while decoding. Case-folded aliases count as duplicates because struct field matching is case-insensitive. Keys in separate objects remain independent.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.