maputil

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastKeysToStrings

func CastKeysToStrings(s any) (map[string]any, error)

func MergeMaps added in v0.160.0

func MergeMaps(a, b map[string]interface{}, opts ...MergeOptions) map[string]interface{}

MergeMaps merges two maps with special handling for nested maps and arrays.

func ParseKey

func ParseKey(key string) []string

func RecursivelyStringifyMapKey added in v1.0.0

func RecursivelyStringifyMapKey(v any) (any, error)

func Set

func Set(m map[string]any, key []string, value string, stringBool bool)

Types

type ArrayMergeStrategy added in v1.3.0

type ArrayMergeStrategy int
const (
	// ArrayMergeStrategySparse uses auto-detection: sparse arrays (with nils) merge
	// element-by-element, complete arrays (no nils) replace entirely.
	ArrayMergeStrategySparse ArrayMergeStrategy = iota
	// ArrayMergeStrategyReplace always replaces arrays entirely.
	ArrayMergeStrategyReplace
	// ArrayMergeStrategyMerge always merges arrays element-by-element (for CLI overrides).
	ArrayMergeStrategyMerge
)

type MergeOptions added in v1.3.0

type MergeOptions struct {
	ArrayStrategy ArrayMergeStrategy
}

Jump to

Keyboard shortcuts

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