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

json

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 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 = config.Unmarshal
	// Marshal is equivalent to encoding/json.Marshal.
	Marshal = config.Marshal
	// NewEncoder is equivalent to encoding/json.NewEncoder.
	NewEncoder = config.NewEncoder
	// NewDecoder is equivalent to encoding/json.NewDecoder.
	NewDecoder = config.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