json

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 1 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalWithCustomFields

func MarshalWithCustomFields(v interface{}, cf map[string]interface{}) ([]byte, error)

MarshalWithCustomFields marshals value merged with custom fields defined in the map into JSON bytes.

func MergeCustomFields

func MergeCustomFields(v interface{}, cf map[string]interface{}) (map[string]interface{}, error)

MergeCustomFields converts value to the JSON-like map and merges it with custom fields map cf.

func ToMap

func ToMap(v interface{}) (map[string]interface{}, error)

ToMap convert object, string or bytes to json object represented by map.

func ToMaps

func ToMaps(v []interface{}) ([]map[string]interface{}, error)

ToMaps convert array to array of json objects.

func UnmarshalWithCustomFields

func UnmarshalWithCustomFields(data []byte, v interface{}, cf map[string]interface{}) error

UnmarshalWithCustomFields unmarshals JSON into value v and puts all JSON fields which do not belong to value into custom fields map cf.

Types

This section is empty.

Jump to

Keyboard shortcuts

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