title: How to create json array and insert json object
body: <p>How to create a json array and insert json objects into it?
  I have a for loop. And in that for loop I'm able to generate a json object. I want to store this in the json array. </p>
  
  <pre><code>for i := 9; i &lt;= 10; i++ {
      var obj map[string]interface{}
      err := json.Unmarshal([]byte("{}"), &amp;obj)
      if err != nil {
          fmt.Println(err)
          return
      }
      obj["key1"] = "val1"
      obj["key2"] = "val2"
      // Here i want to add this json(obj) into an array
  }
  </code></pre>