marshal

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(object any) ([]byte, error)

Marshal returns a JSON encoding of the given object. Included fields: - non-empty value - a basic type whose field's name is present in forceSendFields Nil interfaces, nil pointers, and nil or empty maps and slices are not serialized even if their field name appears in ForceSendFields Embedded structs are still considered a separate struct. ForceSendFields in an embedded struct only impact the fields of the embedded struct. Conversely, an embedded struct is not impacted by the ForceSendFields of the struct containing it.

func Unmarshal

func Unmarshal(data []byte, v any) error

Unmarshals a JSON element and fills in the ForceSendFields field if the struct contains it. Only anotates basic types in the ForceSendFields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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