title: Create a JSON array and JSON object
body: <p>I am developing an app for Go. the app is getting JSON data back from a third party.</p>
  <p>I do not see how to create the json object and append it to a json array. What's happening is that I have a loop and each element received.</p>
  <p>below is the code:</p>
  <pre><code>type PastWeekWeatherArray struct {
      PastWeekWeather []PastDayWeather `json:&quot;array&quot;`
  }
  
  type PastDayWeather struct {
      DayWeather string `json:&quot;day&quot;`
  }
  
  func get_weather(ctx context.Context, place string, date string) (string, error){
  var msg PastWeekWeatherArray
  
  client := darksky.New(apiKey)
  
  for j:= 0; j &lt; 7; j++ {
      forecast, err := client.get_data(j)
      if(err != nil) {
          fmt.Println(err.Error())
          return &quot;&quot;,err
      }
      // forecast.Daily
  }
  </code></pre>
  <p>the data is contained in the forecast.Daily. this response need to be stored in 'PastDayWeather', json obect and then append to the PastWeekWeatherArray</p>
  <p><code>forecast.Daily</code> is returning a (type *Datablock), I would like to cast it or make it a JSON and then insert in the JSON Array.</p>