strictjson

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package strictjson 提供按 Go 类型表达线格式可空性的 editing JSON 共用严格解码器 Package strictjson provides the shared strict decoder for editing JSON whose Go types model wire nullability

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte, out any) error

Decode 严格解码唯一 JSON 值,拒绝未知字段、尾随内容以及不能表示 null 的 Go 类型位置 Decode strictly decodes one JSON value and rejects unknown fields, trailing content, and null at Go type positions that cannot represent it

func RequireObjectFields

func RequireObjectFields(data []byte, path string, names ...string) error

RequireObjectFields 要求 JSON 对象显式包含指定字段并保留缺失与零值或 null 的区别 RequireObjectFields requires a JSON object to explicitly contain the named fields so missing values remain distinct from zero values or null

Types

This section is empty.

Jump to

Keyboard shortcuts

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