maputil

package
v1.0.0-alpha.24 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[T any](m map[string]any, key string) (value T, ok bool)

func GetNested

func GetNested[T any](m map[string]any, path []string) (value T, ok bool)

GetNested reads the value at path, descending one map per segment. An empty path addresses nothing and reports false.

func SetNested

func SetNested(m map[string]any, path []string, value any) error

SetNested writes value at path, creating the intermediate maps it descends through. It is the counterpart to GetNested, and errors when the path descends through a value that is not a map. The converse is not guarded: a write onto a final segment that holds a map replaces the map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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