Documentation
¶
Index ¶
Constants ¶
const MaxDepth = 10000
MaxDepth limits the nesting of arrays, maps and structs while decoding. Without it, deeply nested input exhausts the goroutine stack and the runtime aborts with a fatal error that cannot be recovered.
Variables ¶
var ErrDeclaredLengthTooLarge = errors.New("declared length is too large")
ErrDeclaredLengthTooLarge is returned when a declared 32-bit length cannot be represented as a non-negative int (32-bit platforms).
Functions ¶
func CheckMapKey ¶
func CheckMapKey(key interface{}) error
CheckMapKey reports an error when key would panic as a map key.
func CheckMapKeyValue ¶
CheckMapKeyValue is the reflect.Value variant of CheckMapKey.
func IsExtCode ¶
IsExtCode reports whether code starts an ext value. Map keys decoded from ext values come from user-provided decoders and may be unhashable, while other non-container codes always yield hashable values.
func LengthFromUint32 ¶ added in v2.4.4
LengthFromUint32 converts a MessagePack-declared 32-bit length to int, rejecting values that are not representable as a non-negative int.
func MapKeyNeedsCheck ¶
MapKeyNeedsCheck reports whether a concrete map key type t may still hold unhashable values at runtime (e.g. a struct with an interface field). Interface key types are handled separately by the decoders.
Types ¶
This section is empty.