utils

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeMaps

func MergeMaps(values map[string]interface{}, overrides map[string]interface{}) error

MergeMaps merges `overrides` into `values` with rules:

  • If both sides are map[string]interface{}, merge recursively.
  • If key does not exist in values, set it.
  • If either side is nil, simple override.
  • For non-map (simple) types, always override (even if types differ).
  • If BOTH sides are maps but of DIFFERENT map types (e.g., map[string]string vs map[string]interface{}), return error.
  • If values is a map and overrides is a non-map (non-nil), return error. (Overriding a map with a non-map is disallowed; overriding with nil is allowed.)
  • If both sides are maps of the SAME non-MSI type, simple override (no recursion).

func UnflattenMap

func UnflattenMap(m map[string]string) (map[string]interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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