marshaller
v1.4.0
go.gh.ink/json/marshaller
Documentation
pkg.go.dev ↗Functions
Marshal
func Marshal(v any) ([]byte, error)
Marshal encodes v as JSON using the backend selected at build time.
Preheat
func Preheat(vt reflect.Type) error
Preheat compiles the codec for vt ahead of its first use. It is a no-op on backends that have nothing to compile.
PreheatMany
func PreheatMany(vts []reflect.Type) error
PreheatMany is the batch form of Preheat.
Unmarshal
func Unmarshal(data []byte, v any) error
Unmarshal decodes JSON into v using the backend selected at build time.
Map key types are settled before the backend is called. When Unmarshal reports an error the contents of v are unspecified: backends differ in how much of a malformed document they apply before giving up. encoding/json makes the same reservation for anything past the first error.