Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

marshaller

v1.4.0
go.gh.ink/json/marshaller

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

5 matches

Top ↑

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.

Dependency graph