json

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Unmarshal is equivalent to encoding/json.Unmarshal.
	Unmarshal = sonicjson.ConfigDefault.Unmarshal
	// Marshal is equivalent to encoding/json.Marshal.
	Marshal = sonicjson.ConfigDefault.Marshal
	// NewEncoder is equivalent to encoding/json.NewEncoder.
	NewEncoder = sonicjson.ConfigDefault.NewEncoder
	// NewDecoder is equivalent to encoding/json.NewDecoder.
	NewDecoder = sonicjson.ConfigDefault.NewDecoder
	// MarshalForDeterministicTesting marshals a value to JSON in a deterministic way for testing.
	// The normal sonic configuration does not guarantee deterministic output in terms of field order.
	// It panics if called outside of tests.
	MarshalForDeterministicTesting = func(v interface{}) ([]byte, error) {
		if !testing.Testing() {
			panic("MarshalForDeterministicTesting can only be called from tests")
		}
		return sonicjson.ConfigStd.Marshal(v)
	}
)

Functions

This section is empty.

Types

type Marshaler

type Marshaler = func(interface{}) ([]byte, error)

Marshaler is the function signature of encoding/json.Marshal.

type RawMessage

type RawMessage = sonicjson.NoCopyRawMessage

RawMessage is equivalent to encoding/json.RawMessage.

Jump to

Keyboard shortcuts

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