util

package
v0.0.0-...-0cf6527 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalAndDeleteEmpty

func MarshalAndDeleteEmpty(marshalable interface{}, paths []string) ([]byte, error)

MarshalAndDeleteEmpty marshals a JSON object, then uses gjson to delete empty objects at the given gjson paths.

This can be used as a convenient way to create a marshaler that omits empty non-pointer structs. See mautrix.RespSync for example.

Types

This section is empty.

Jump to

Keyboard shortcuts

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