Help us shape the future of Go! Take the 2026 Go Developer Survey

jsoncodec

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package jsoncodec contains application JSON methods before native JSON error inspection. Foreign codecs receive opaque failures; callers receive safe, inspectable causes after the codec has returned.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(input any, options ...jsonv2.Options) (data []byte, err error)

func MarshalEncode

func MarshalEncode(enc *jsontext.Encoder, input any) error

MarshalEncode protects framework streaming delegation while retaining the encoder's options. Caller-installed WithMarshalers functions keep precedence: their implementation and native invocation belong to that caller; this boundary contains the JSON/text methods selected after those functions decline.

func MarshalWrite

func MarshalWrite(output io.Writer, input any, options ...jsonv2.Options) error

func MethodError

func MethodError(err error) error

MethodError returns a safe native JSON callback failure. Native JSON owns the outer operation, so this retains contained Is/As without an outer Reveal call.

func Unmarshal

func Unmarshal(data []byte, output any, options ...jsonv2.Options) error

func UnmarshalExact

func UnmarshalExact(data []byte, output any, options ...jsonv2.Options) error

UnmarshalExact retains json.Number at dynamic interface boundaries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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