title: How can i declare list of maps in golang
body: <p>i am not getting how should i format the struct in golang so that i can get the list of maps (key/value pairs) in JSON format ?
  So far i tried with this </p>
  
  <pre><code>package main
  
  import (
  "encoding/json"
  "fmt"
  )
  
  func main() {
  map1 := map[string]interface{}{"dn": "abc", "status": "live", "version": 2, "xyz": 3}
  map2, _ := json.Marshal(map1)
  fmt.Println(string(map2))
  }
  </code></pre>
  
  <p>here it is just printing key/value pairs...</p>
  
  <blockquote>
    <p>{"dn":"abc","status":"live","version":2,"xyz":3}</p>
  </blockquote>
  
  <p>but i need output something like this :</p>
  
  <blockquote>
    <p>[{"dn":"abc","status":"live"},{"version":2,"xyz":3}]</p>
  </blockquote>