decodingutil

package
v2.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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

This section is empty.

Functions

func CheckMapKey

func CheckMapKey(key interface{}) error

CheckMapKey reports an error when key would panic as a map key.

func CheckMapKeyValue

func CheckMapKeyValue(key reflect.Value) error

CheckMapKeyValue is the reflect.Value variant of CheckMapKey.

func DepthError

func DepthError() error

DepthError reports that the nesting limit was exceeded.

func IsExtCode

func IsExtCode(code byte) bool

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 MapKeyNeedsCheck

func MapKeyNeedsCheck(t reflect.Type) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL