title: How to create a list of the dictionaries in Golang?
body: <p>I'm a newbie in Golang.</p>
  <p>I'm going to create a list of dictionaries that is resizable (this is not static) with append some <code>dict</code> to the <code>list</code>. Then I want to write it on a file, but I was confused.</p>
  <p>I want something like this:</p>
  <pre><code>[
   {&quot;port&quot;: 161, &quot;timeout&quot;: 1, &quot;sleep_time&quot;: 5, &quot;metrics&quot;: [
    {&quot;tag_name&quot;: &quot;output_current&quot;, &quot;id&quot;: 3},
    {&quot;tag_name&quot;: &quot;input_voltage&quot;, &quot;id&quot;: 2}
   ]},
   {&quot;port&quot;: 161, &quot;timeout&quot;: 1, &quot;sleep_time&quot;: 4, &quot;metrics&quot;: [
     {&quot;tag_name&quot;: &quot;destructor&quot;, &quot;id&quot;: 10}
   ]}
  ]
  </code></pre>
  <hr />
  <p>[UPDATE]:</p>
  <p>What is the <code>.append()</code> Python equivalent in Go language like the following code snippet?</p>
  <pre><code>list_ = []
  dict_ = {&quot;key&quot;: val}
  list_.append(dict_)
  </code></pre>
  <p>I've found the answer to this section ([UPDATE]) by borrowing from <a href="https://stackoverflow.com/a/53846458/3702377">this answer</a>:</p>
  <pre><code>type Dictionary map[string]interface{}
  data := []Dictionary{}
  dict1 := Dictionary{&quot;key&quot;: 1}
  dict2 := Dictionary{&quot;key&quot;: 2}
  data = append(data, dict1, dict2)
  </code></pre>