maputil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNestedKey

func GetNestedKey(m map[string]any, dotPath string) (any, bool)

GetNestedKey retrieves a value from a nested map using a dot-separated path. Returns the value and a boolean indicating whether it was found. e.g. GetNestedKey(m, "userform.applicant_name") returns (m["userform"]["applicant_name"], true)

func SetNestedKey

func SetNestedKey(m map[string]any, dotPath string, value any)

SetNestedKey sets a value in a map using a dot-separated path. e.g. SetNestedKey(m, "userform.applicant_name", "Acme") sets m["userform"]["applicant_name"] = "Acme" If the target key and the incoming value are both map[string]any, they are recursively merged. Assigned values (like nested maps/slices) are deep-copied.

Types

This section is empty.

Jump to

Keyboard shortcuts

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