Documentation
¶
Overview ¶
Package jsonutil provides hardened JSON decoding helpers for untrusted input. Invariants: duplicate object keys are rejected; strict mode can reject unknown fields.
Index ¶
Constants ¶
View Source
const MaxSafeInt int64 = (1 << 53) - 1
MaxSafeInt is the maximum integer exactly representable in JSON (2^53 - 1).
Variables ¶
This section is empty.
Functions ¶
func DecodeNoDup ¶
DecodeNoDup decodes JSON into a Go struct while enforcing no duplicate keys. Unknown fields are allowed for forward compatibility.
func DecodeStrict ¶
DecodeStrict decodes JSON into a Go struct while enforcing no duplicate keys and disallowing unknown fields.
func ValidateNoDuplicateKeys ¶
ValidateNoDuplicateKeys checks for duplicate object keys in JSON. Uses streaming because json.Unmarshal silently keeps only the last duplicate.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.