xstructs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package xstructs provides functionality for working with structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToMap

func ToMap(obj any) (map[string]any, error)

ToMap converts a struct or map to a map[string]any. It handles nested structs, maps, and slices. It uses the "json" and "yaml" tags to determine the key names. It respects the `omitempty` tag for fields. It respects the `inline` tag for nested structs. It respects the `-` tag to omit fields.

If the input is nil, it returns nil. If the input is not a struct or map, it returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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