Documentation
¶
Overview ¶
Package xstructs provides functionality for working with structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToMap ¶
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.
Click to show internal directories.
Click to hide internal directories.