merge
Syntax
collections.Merge MAP MAP...
merge MAP MAP...
Merge creates a copy of the final MAP
and merges any preceeding MAP
into it in reverse order.
Key handling is case-insensitive.
An example merging two maps.
{{ $default_params := dict "color" "blue" "width" "50%" "height" "25%" }}
{{ $user_params := dict "color" "red" "extra" (dict "duration" 2) }}
{{ $params := merge $default_params $user_params }}
Resulting $params:
"color": "red"
"extra":
"duration": 2
"height": "25%"
"icon": "mail"
"width": "50%"