<p>I am trying to define a collection (<code>dict</code>), and I would like to add a new line on each definition (for readability), Eg:</p>

<pre><code>{{ $deployment := dict 
"Release" .Release 
"Chart" .Chart 
"Values" .Values }}
</code></pre>

<p>But when I do this, helm respond a parse error : </p>

<pre><code>Error: parse error in "XXX": template: XXX:2: unclosed action
Error: UPGRADE FAILED: parse error in "XXX": template: XXX:2: unclosed action
</code></pre>

<p>Is there a way in HELM to do this?</p>

<p>I achieved this by defining the dict first and then setting one key per line.</p>

<pre><code>{{- $myDict := dict "" "" -}}
{{- $_ := set $myDict "myKey1" "myValue1" -}}
{{- $_ := set $myDict "myKey2" "myValue2" -}}
{{- $_ := set $myDict "myKey3" "myValue3" -}}
{{- $_ := set $myDict "myKey4" "myValue4" -}}
</code></pre>

<p>Bonus Tip: Since dict <code>get</code> function is available seemingly in only helm3 and later, you can use this hack to get a value from a dict to a string.</p>

<pre><code>{{/* Hack needed until helm 3 which has 'get' for 'dict' */}}
{{- $myValue3Var := pluck "myKey3" $myDict | first -}}
</code></pre>
