Constructors

Name Description Usage Samples
mkMap Creates map[string]string, parameters count must be even (2,4,etc), first is key and second - value mkMap(key, value, …) {{ m := mkMap “key” “val” “key2” “val2” }}
mkAnyMap Creates map[string]any, parameters count must be even (2,4,etc), first is key and second - value mkAnyMap(key, value, …) {{ m := mkAnyMap “key” “val” “key2” 2 }}
mkCtxMap Creates map[string]any, first parameter should be the template context (the dot), rest is the same as mkAnyMap. This function makes sure that everything in the context is still available when used as a passing function to pass data to partials. mkCtxMap(., key, value, …) {{ m := mkCtxMap . “key” “val” “key2” 2 }}
mkIntArray Creates array (slice) of integers, if parameters not passed then empty array created mkIntArray(1, 2, …) {{ m := mkIntArray 1 2 }}
mkStringArray Creates array (slice) of strings, if parameters not passed then empty array created mkStringArray(“foo”, “bar”, …) {{ m := mkStringArray “foo” “bar” }}