jsonobject

package
v0.0.14-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jsonobject normalizes stored JSON object documents.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("value must be exactly one JSON object")

ErrInvalid reports a value that is not exactly one JSON object.

Functions

func Normalize

func Normalize(raw json.RawMessage) (json.RawMessage, error)

Normalize returns one stable encoding of a JSON object: an empty value becomes {}, members are sorted by name, insignificant whitespace is removed and numbers keep their literal text. Anything other than a single object, including null and trailing values, fails with ErrInvalid.

Objects with the same members and number literals therefore encode identically, which stored snapshots and retry identities rely on. It is not a general canonical JSON form: strings keep encoding/json's escaping, numbers are not rewritten (1 and 1.0 differ) and a repeated member keeps its last value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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